diff options
-rw-r--r-- | src/MTS_IO_CellularRadio.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/MTS_IO_CellularRadio.cpp b/src/MTS_IO_CellularRadio.cpp index 71c4465..0ec7c05 100644 --- a/src/MTS_IO_CellularRadio.cpp +++ b/src/MTS_IO_CellularRadio.cpp @@ -936,8 +936,27 @@ CellularRadio::CODE CellularRadio::getNetworkStatus(Json::Value& jData) { const uint32_t LTE_NETWORK_FORMAT = 16; printTrace("%s| Get Network Status", m_sName.c_str()); - std::string sCmd("AT#RFSTS"); - std::string sResult = sendCommand(sCmd, DEFAULT_BAIL_STRINGS, 200); + + std::string sCmd; + std::string sResult; + // LE910 radios have a bug where issuing AT#RFSTS with a locked SIM + // will cause the radio to stop responding until a radio power cycle + // Telit Support Portal Case #5069697 + if (m_sName.find("LE910-") != std::string::npos) { + sCmd = "AT+CPIN?"; + sResult = sendCommand(sCmd); + if (sResult.find("+CPIN:") == std::string::npos) { + printDebug("%s| AT+CPIN? returned unexpected response: [%s][%s]", m_sName.c_str(), sCmd.c_str(), sResult.c_str()); + return FAILURE; + } + if (sResult.find("SIM PIN") != std::string::npos) { + printError("%s| The SIM is locked and must first be unlocked", m_sName.c_str()); + return FAILURE; + } + } + + sCmd = "AT#RFSTS"; + sResult = sendCommand(sCmd, DEFAULT_BAIL_STRINGS, 200); if (sResult.find("#RFSTS:") == std::string::npos) { printDebug("%s| Network Status command returned unexpected response: [%s][%s]", m_sName.c_str(), sCmd.c_str(), sResult.c_str()); return FAILURE; |