From 57f3714c9ae1287e842fa32f14832d3e4d15e96d Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Mon, 14 Mar 2016 16:25:24 -0500 Subject: fix: set +CGREG back to 0 (default) after querying LAC --- src/MTS_IO_CellularRadio.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/MTS_IO_CellularRadio.cpp b/src/MTS_IO_CellularRadio.cpp index 8eb35d5..7234a98 100644 --- a/src/MTS_IO_CellularRadio.cpp +++ b/src/MTS_IO_CellularRadio.cpp @@ -18,9 +18,9 @@ * */ -/*! +/*! \file MTS_IO_CellularRadio.cpp - \brief A brief description + \brief A brief description \date Nov 5, 2014 \author sgodinez @@ -1047,6 +1047,7 @@ CellularRadio::CODE CellularRadio::getNetworkStatus(Json::Value& jData) { jData[KEY_ABND] = radioBandMap.getRadioBandName(); // Get the LAC for the LTE radio that's not in the #RFSTS response + // Temporarily set CGREG=2 to get more info sCmd = "AT+CGREG=2"; sResult = sendCommand(sCmd); if (sResult.find("OK") == std::string::npos) { @@ -1062,6 +1063,12 @@ CellularRadio::CODE CellularRadio::getNetworkStatus(Json::Value& jData) { std::vector vParts = MTS::Text::split(MTS::Text::trim(sResult.substr(start)), ","); jData[KEY_LAC] = MTS::Text::strip(vParts[2], '"'); } + // Revert CGREG to default + sCmd = "AT+CGREG=0"; + sResult = sendCommand(sCmd); + if (sResult.find("OK") == std::string::npos) { + printDebug("%s| AT#CGREG=0 returned unexpected response: [%s][%s]", m_sName.c_str(), sCmd.c_str(), sResult.c_str()); + } if(MTS::Text::parse(iValue, vParts[14]) && convertServiceDomainToString((SERVICEDOMAIN)iValue, sValue) == SUCCESS) { jDebug[KEY_SD] = sValue; -- cgit v1.2.3