diff options
author | Jesse Gilles <jgilles@multitech.com> | 2015-09-09 10:40:45 -0500 |
---|---|---|
committer | Jesse Gilles <jgilles@multitech.com> | 2015-09-09 10:40:45 -0500 |
commit | 603bdced78ec4fb0ab55816182cf39dadd301ab6 (patch) | |
tree | a7d9b6c4178bf7aca75de8b33cc5d03e8894d529 /src | |
parent | e17accd33c55f5eb83f19a05a0abe953d1bf7f0a (diff) | |
download | libmts-io-603bdced78ec4fb0ab55816182cf39dadd301ab6.tar.gz libmts-io-603bdced78ec4fb0ab55816182cf39dadd301ab6.tar.bz2 libmts-io-603bdced78ec4fb0ab55816182cf39dadd301ab6.zip |
use CGREG? to query registration for LE910 models
Resolution for LE910-based MTSMCs
https://support.multitech.com/support/case.html?action=view&id=63163
Diffstat (limited to 'src')
-rw-r--r-- | src/MTS_IO_CellularRadio.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/MTS_IO_CellularRadio.cpp b/src/MTS_IO_CellularRadio.cpp index 382db3b..129a3ae 100644 --- a/src/MTS_IO_CellularRadio.cpp +++ b/src/MTS_IO_CellularRadio.cpp @@ -1097,9 +1097,21 @@ void CellularRadio::initMipProfile(Json::Value& jData) { } CellularRadio::CODE CellularRadio::getRegistration(REGISTRATION& eRegistration) { - std::string sCmd("AT+CREG?"); + std::string sCmd; + std::string sResp; + + if (m_sName.find("LE910-") != std::string::npos) { + // use AT+CGREG instead for LE910 models + sCmd = "AT+CGREG?"; + sResp = "+CGREG: "; + } + else { + sCmd = "AT+CREG?"; + sResp = "+CREG: "; + } + std::string sResult = sendCommand(sCmd, DEFAULT_BAIL_STRINGS, 5000); - if (sResult.find("+CREG: ") == std::string::npos) { + if (sResult.find(sResp) == std::string::npos) { if(sResult.size() == 0) { printDebug("%s| Registration command returned no response: [%s]", m_sName.c_str()); return NO_RESPONSE; |