summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Bayer <bbayer@multitech.com>2016-03-14 16:25:24 -0500
committerBrandon Bayer <bbayer@multitech.com>2016-03-14 16:25:24 -0500
commit57f3714c9ae1287e842fa32f14832d3e4d15e96d (patch)
tree110fa5b893410064f4142a374bb12c0d2910e5fe
parentc4d699baf96736b89c0335fc488e0ab2dc2d9cd3 (diff)
downloadlibmts-io-57f3714c9ae1287e842fa32f14832d3e4d15e96d.tar.gz
libmts-io-57f3714c9ae1287e842fa32f14832d3e4d15e96d.tar.bz2
libmts-io-57f3714c9ae1287e842fa32f14832d3e4d15e96d.zip
fix: set +CGREG back to 0 (default) after querying LAC
-rw-r--r--src/MTS_IO_CellularRadio.cpp11
1 files changed, 9 insertions, 2 deletions
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<std::string> 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;