diff options
| -rw-r--r-- | src/MTS_IO_EG95Radio.cpp | 12 | 
1 files changed, 10 insertions, 2 deletions
| diff --git a/src/MTS_IO_EG95Radio.cpp b/src/MTS_IO_EG95Radio.cpp index f934e50..7705e64 100644 --- a/src/MTS_IO_EG95Radio.cpp +++ b/src/MTS_IO_EG95Radio.cpp @@ -67,15 +67,23 @@ ICellularRadio::CODE EG95Radio::setCellularMode(CELLULAR_MODES networks) {          default: printError("Unhandled preferred network flag.");          }      } +      std::string sCmd;      if (prefNet.size() == 2) { // *g-only          sCmd = "AT+QCFG=\"nwscanmode\"," + std::to_string(prefOnly);      } else { // preferred -        sCmd = "AT+QCFG=\"nwscanseq\"," + prefNet; +        sCmd = "AT+QCFG=\"nwscanmode\",0";      }      std::string cmdResult = sendCommand(sCmd);      if (cmdResult.find(ICellularRadio::RSP_OK) == std::string::npos) { -        printDebug("%s| AT+QCFG returned unexpected response: [%s][%s]", getName().c_str(), sCmd.c_str(), cmdResult.c_str()); +        printDebug("%s| AT+QCFG=\"nwscanmode\" returned unexpected response: [%s][%s]", getName().c_str(), sCmd.c_str(), cmdResult.c_str()); +        return FAILURE; +    } + +    sCmd = "AT+QCFG=\"nwscanseq\"," + prefNet; +    cmdResult = sendCommand(sCmd); +    if (cmdResult.find(ICellularRadio::RSP_OK) == std::string::npos) { +        printDebug("%s| AT+QCFG=\"nwscanseq\" returned unexpected response: [%s][%s]", getName().c_str(), sCmd.c_str(), cmdResult.c_str());          return FAILURE;      }      return SUCCESS; | 
