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_CellularRadio.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_CellularRadio.cpp')
-rw-r--r-- | src/MTS_IO_CellularRadio.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/MTS_IO_CellularRadio.cpp b/src/MTS_IO_CellularRadio.cpp index 1850a60..6236c3f 100644 --- a/src/MTS_IO_CellularRadio.cpp +++ b/src/MTS_IO_CellularRadio.cpp @@ -1609,3 +1609,57 @@ ICellularRadio::CODE CellularRadio::getUeModeOfOperation(ICellularRadio::UE_MODE mode = ICellularRadio::UE_MODES_OF_OPERATION::UNKNOWN_MODE; return NOT_APPLICABLE; } + +ICellularRadio::CODE CellularRadio::disableVoiceSupport() { + printTrace("%s| Disable Voice Support: not applicable", m_sName.c_str()); + return NOT_APPLICABLE; +} + +ICellularRadio::CODE CellularRadio::getVoiceSupport(Json::Value& jData) { + bool bVoiceEnabled, bSmsOnly; + CODE rc; + + rc = getVoiceSupport(bVoiceEnabled, bSmsOnly); + + if (rc == SUCCESS) { + jData[KEY_VOICE_ENABLED] = bVoiceEnabled; + jData[KEY_SMS_ONLY] = bSmsOnly; + } + + return rc; +} + +ICellularRadio::CODE CellularRadio::getVoiceSupport(bool&, bool&) { + printTrace("%s| Get Voice Support: not applicable", m_sName.c_str()); + return NOT_APPLICABLE; +} + +ICellularRadio::CODE CellularRadio::sendBasicQuery(const std::string& sCmd, const std::string& sLabel, std::string& sResult, int32_t iTimeoutMillis, const char& ESC) { + sResult = sendCommand(sCmd, DEFAULT_BAIL_STRINGS, iTimeoutMillis, ESC); + printTrace("%s| Got response from the radio: [%s]", getName().c_str(), sResult.c_str()); + + if (sResult.empty()) { + return NO_RESPONSE; + } + + if (sResult.rfind(ICellularRadio::RSP_ERROR) != std::string::npos) { + return ERROR; + } + + size_t end = sResult.rfind(ICellularRadio::RSP_OK); + if (end == std::string::npos) { + printError("%s| \"OK\" not found in the response: [%s]", getName().c_str(), sResult.c_str()); + return FAILURE; + } + + size_t start = sResult.find(sLabel); + if (start == std::string::npos) { + printError("%s| Unexpected radio response: [%s]", getName().c_str(), sResult.c_str()); + return FAILURE; + } + + start += sLabel.length(); + sResult = MTS::Text::trim(sResult.substr(start, end-start)); + + return SUCCESS; +} |