From 4df714d95f33006ee1d38b6719e3548b98355984 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Wed, 18 May 2016 16:14:08 -0500 Subject: [IN1892] fix: return basic stats instead of null on LTE without signal Response on LTE without signal will now be: { "datetime" : "01/06/80 00:01:31 GMT+5", "roaming" : false, "rssi" : 99, "service" : "Unknown" } instead of null --- src/MTS_IO_CellularRadio.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/MTS_IO_CellularRadio.cpp b/src/MTS_IO_CellularRadio.cpp index c5b503d..cb1a59c 100644 --- a/src/MTS_IO_CellularRadio.cpp +++ b/src/MTS_IO_CellularRadio.cpp @@ -959,6 +959,16 @@ CellularRadio::CODE CellularRadio::getNetworkStatus(Json::Value& jData) { 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()); + + if (sResult.find(CellularRadio::RSP_OK) < 3) { + //Command returns only "OK". Actual response is usually "\r\nOK", so check index < 3 + //This will happen when LTE radios don't have a signal + //Since AT#RFSTS failed, just get common network stats and return + //This will update RSSI which'll show that signal is gone + getCommonNetworkStats(jData); + printTrace("%s| Network Status:\n%s\n", m_sName.c_str(), jData.toStyledString().c_str()); + return SUCCESS; + } return FAILURE; } -- cgit v1.2.3