From 603bdced78ec4fb0ab55816182cf39dadd301ab6 Mon Sep 17 00:00:00 2001 From: Jesse Gilles Date: Wed, 9 Sep 2015 10:40:45 -0500 Subject: use CGREG? to query registration for LE910 models Resolution for LE910-based MTSMCs https://support.multitech.com/support/case.html?action=view&id=63163 --- src/MTS_IO_CellularRadio.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/MTS_IO_CellularRadio.cpp') 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; -- cgit v1.2.3