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_QuectelRadio.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_QuectelRadio.cpp')
| -rw-r--r-- | src/MTS_IO_QuectelRadio.cpp | 92 | 
1 files changed, 92 insertions, 0 deletions
| diff --git a/src/MTS_IO_QuectelRadio.cpp b/src/MTS_IO_QuectelRadio.cpp index b6eab80..7a1a1a7 100644 --- a/src/MTS_IO_QuectelRadio.cpp +++ b/src/MTS_IO_QuectelRadio.cpp @@ -37,6 +37,7 @@ const std::string QuectelRadio::CMD_ABORT_UPLOAD = "+++";  // It is strongly recommended to use DOS 8.3 file name format for <filename>.  const std::string QuectelRadio::VALUE_MTS_DELTA_NAME = "mtsdelta.zip";  const std::string QuectelRadio::VALUE_MTS_DELTA_PATH =  "/data/ufs/" + QuectelRadio::VALUE_MTS_DELTA_NAME; +const std::string QuectelRadio::VALUE_QNVR_DISABLE_VOICE = "0102000000000000";  QuectelRadio::QuectelRadio(const std::string& sName, const std::string& sRadioPort)  : CellularRadio (sName, sRadioPort) @@ -1376,3 +1377,94 @@ ICellularRadio::CODE QuectelRadio::getUeModeOfOperation(ICellularRadio::UE_MODES      mode = ICellularRadio::UE_MODES_OF_OPERATION::UNKNOWN_MODE;      return FAILURE;  } + +ICellularRadio::CODE QuectelRadio::disableVoiceSupport() { +    printTrace("%s| Disable Voice Support", getName().c_str()); + +    CODE rc; +    const int dTimeout = 1000; // ms +    std::string sCommand = "AT+QNVFW=\"/nv/item_files/ims/IMS_enable\",00"; + +    rc = sendBasicCommand(sCommand, dTimeout); +    if (rc != SUCCESS) { +        printError("%s| Failed to disable IMS support: [%d]", getName().c_str(), rc); +        return rc; +    } + +    sCommand = "AT+QNVW=5280,0,\"0102000000000000\""; + +    rc = sendBasicCommand(sCommand, dTimeout); +    if (rc != SUCCESS) { +        printError("%s| Failed to disable voice support via +QNVW=5280,0: [%d]", getName().c_str(), rc); +        return rc; +    } + +    sCommand = "AT+QNVFW=\"/nv/item_files/modem/mmode/sms_only\",01"; + +    rc = sendBasicCommand(sCommand, dTimeout); +    if (rc != SUCCESS) { +        printError("%s| Failed to enable \"SMS only\" registration flag: [%d]", getName().c_str(), rc); +        return rc; +    } + +    return SUCCESS; +} + +ICellularRadio::CODE QuectelRadio::getVoiceSupport(bool& bVoiceEnabled, bool& bSmsOnly) { +    printTrace("%s| Get Voice Support status", getName().c_str()); + +    CODE rc; + +    bool bImsEnabled = false; +    const int dTimeout = 1000; // ms + +    std::string sResult; +    std::string sCommand; +    std::string sLabel; + +    bVoiceEnabled = false; +    bSmsOnly = false; + +    printTrace("%s| Get IP Multimedia Subsystem status", getName().c_str()); +    sCommand = "AT+QNVFR=\"/nv/item_files/ims/IMS_enable\""; +    sLabel = "+QNVFR: "; + +    rc = sendBasicQuery(sCommand, sLabel, sResult, dTimeout); +    if (rc != SUCCESS) { +        return rc; +    } + +    if (sResult != "00") { +        bImsEnabled = true; +    } + +    printTrace("%s| Get +QNVR=5280,0 status", getName().c_str()); +    sCommand = "AT+QNVR=5280,0"; +    sLabel = "+QNVR: "; + +    rc = sendBasicQuery(sCommand, sLabel, sResult, dTimeout); +    if (rc != SUCCESS) { +        return rc; +    } + +    sResult = MTS::Text::strip(sResult, '"'); + +    if (bImsEnabled || sResult != VALUE_QNVR_DISABLE_VOICE) { +        bVoiceEnabled = true; +    } + +    printTrace("%s| Get \"SMS only\" registration status", getName().c_str()); +    sCommand = "AT+QNVFR=\"/nv/item_files/modem/mmode/sms_only\""; +    sLabel = "+QNVFR: "; + +    rc = sendBasicQuery(sCommand, sLabel, sResult, dTimeout); +    if (rc != SUCCESS) { +        return rc; +    } + +    if (sResult == "01") { +        bSmsOnly = true; +    } + +    return SUCCESS; +} | 
