diff options
author | Mykola Salomatin <mykola.salomatin@globallogic.com> | 2021-09-29 16:20:21 +0300 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2022-04-18 13:46:51 -0500 |
commit | 166af1c1bd7c9a0368d046261bab2162a37a7dc2 (patch) | |
tree | d9e62a1a039fc9a25d67ec4ef6ad2a260ad97ce0 /src/MTS_IO_LE910C4NFRadio.cpp | |
parent | 8eb97c149a08f6ec9d938be53868ee426895bf0e (diff) | |
download | libmts-io-166af1c1bd7c9a0368d046261bab2162a37a7dc2.tar.gz libmts-io-166af1c1bd7c9a0368d046261bab2162a37a7dc2.tar.bz2 libmts-io-166af1c1bd7c9a0368d046261bab2162a37a7dc2.zip |
[MTX-4206] mPower R.6.0: Making Telit and Quectel radios data-only on AT&T network. GP-1364
Add 2 functions for Telit and Quectel modems:
- disableVoiceSupport: disable voice support (IMS and CSFB) and enable SMS only registration flag.
- getVoiceSupport: get voice support configuration for the current radio.
Diffstat (limited to 'src/MTS_IO_LE910C4NFRadio.cpp')
-rw-r--r-- | src/MTS_IO_LE910C4NFRadio.cpp | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/src/MTS_IO_LE910C4NFRadio.cpp b/src/MTS_IO_LE910C4NFRadio.cpp index 770a2c4..0f7bb92 100644 --- a/src/MTS_IO_LE910C4NFRadio.cpp +++ b/src/MTS_IO_LE910C4NFRadio.cpp @@ -128,3 +128,79 @@ CellularRadio::CODE LE910C4NFRadio::getActiveFirmware(std::string& sFwId) { TelitRadio::FOTA_GROUP LE910C4NFRadio::getFotaGroup() { return VALUE_GROUP_B; } + +CellularRadio::CODE LE910C4NFRadio::getIsVoiceSupportConfigurable() { + CellularRadio::CODE rc; + const std::string sCommand = "AT#CALLDISA=?"; + + rc = sendBasicCommand(sCommand); + if (rc == ERROR) { + printTrace("%s| This radio does not support voice call enable/disable", getName().c_str()); + return NOT_APPLICABLE; + } + + return rc; +} + +CellularRadio::CODE LE910C4NFRadio::disableVoiceSupport() { + printTrace("%s| Disable Voice Support", getName().c_str()); + + CellularRadio::CODE rc; + + rc = getIsVoiceSupportConfigurable(); + if (rc != SUCCESS) { + return rc; + } + + const int dTimeout = 1000; // ms + const std::string sCommand = "AT#CALLDISA=1,1"; + + return sendBasicCommand(sCommand, dTimeout); +} + +CellularRadio::CODE LE910C4NFRadio::getVoiceSupport(bool& bVoiceEnabled, bool& bSmsOnly) { + printTrace("%s| Get Voice Support", getName().c_str()); + + CellularRadio::CODE rc; + + bVoiceEnabled = false; + bSmsOnly = false; + + rc = getIsVoiceSupportConfigurable(); + if (rc != SUCCESS) { + return rc; + } + + const int dTimeout = 1000; // ms + const std::string sCommand = "AT#CALLDISA?"; + const std::string sLabel = "#CALLDISA: "; + std::string sResult; + + rc = sendBasicQuery(sCommand, sLabel, sResult, dTimeout); + if (rc != SUCCESS) { + return rc; + } + + std::vector<std::string> vParts = MTS::Text::split(sResult, ','); + if (vParts.size() != 2) { + printError("Unexpected number of parameters in response [%s]", sResult.c_str()); + return FAILURE; + } + + /* + * vParts[0] - value indicating that "voice support" is enabled. + * Valid parameters: + * 0 - Enable voice support + * 1 - Disable voice support + * 2 - Disable voice support (same as 1) + * + * vParts[1] - value indicating that "SMS only" registration flag is enabled. + * Valid parameters: + * 0 - Disable "SMS only" registration flag + * 1 - Enable "SMS only" registration flag + */ + bVoiceEnabled = (vParts[0] == "0"); + bSmsOnly = (vParts[1] == "1"); + + return SUCCESS; +} |