From ea4e0213f94a1014a0b4f0e0e43c3222eddc177a Mon Sep 17 00:00:00 2001 From: Serhii Kostiuk Date: Tue, 11 Jun 2019 16:11:14 +0300 Subject: [MTS-MTQ] QuectelRadio implementation Converted the following functions to protected virtual functions: - CellularRadio::queryLteLac - CellularRadio::setCGREG - CellularRadio::queryCGREGstring Those functions are handy to fetch LAC in LTE mode for both Quectel and Telit radios. Also fixed comments and debug messages for the mentioned functions. --- src/MTS_IO_CellularRadio.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/MTS_IO_CellularRadio.cpp b/src/MTS_IO_CellularRadio.cpp index 092da35..ee4e9ec 100644 --- a/src/MTS_IO_CellularRadio.cpp +++ b/src/MTS_IO_CellularRadio.cpp @@ -670,7 +670,7 @@ CellularRadio::CODE CellularRadio::getStaticInformation(Json::Value& jData) { - */ -// Get the LAC for the LTE radio that's not in the #RFSTS response +// Get the LAC for the LTE radio that's not in the #RFSTS or +QENG response std::string CellularRadio::queryLteLac() { std::string CGREGstring; std::string originalCGREG; @@ -690,7 +690,7 @@ std::string CellularRadio::queryLteLac() { if (CGREGstring == RSP_ERROR) { result = VALUE_UNKNOWN; } else { - size_t start = CGREGstring.find(":") + 1; //Position right after "#RFSTS:" + size_t start = CGREGstring.find(":") + 1; //Position right after "+CGREG:" std::vector vParts = MTS::Text::split(MTS::Text::trim(CGREGstring.substr(start)), ","); if(vParts.size() < 3) { result = VALUE_UNAVAILABLE; @@ -708,7 +708,7 @@ void CellularRadio::setCGREG(std::string value) { std::string sCmd("AT+CGREG=" + value); std::string cmdResult(sendCommand(sCmd)); if (cmdResult.find("OK") == std::string::npos) { - printDebug("%s| AT#CGREG=%s returned unexpected response: [%s][%s]", m_sName.c_str(), value.c_str(), sCmd.c_str(), cmdResult.c_str()); + printDebug("%s| AT+CGREG=%s returned unexpected response: [%s][%s]", m_sName.c_str(), value.c_str(), sCmd.c_str(), cmdResult.c_str()); } } @@ -716,7 +716,7 @@ std::string CellularRadio::queryCGREGstring() { std::string sCmd("AT+CGREG?"); std::string cmdResult(sendCommand(sCmd)); if (cmdResult.find("+CGREG:") == std::string::npos) { - printDebug("%s| AT#CGREG? returned unexpected response: [%s][%s]", m_sName.c_str(), sCmd.c_str(), cmdResult.c_str()); + printDebug("%s| AT+CGREG? returned unexpected response: [%s][%s]", m_sName.c_str(), sCmd.c_str(), cmdResult.c_str()); return RSP_ERROR; } return cmdResult; -- cgit v1.2.3