From 646b36e1e1f26e01b4675e2265ee83a5aca55cf2 Mon Sep 17 00:00:00 2001 From: Jeff Hatch Date: Wed, 24 May 2017 09:28:28 -0500 Subject: Add support for LE910NA1 Radio --- src/MTS_IO_CellularRadio.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src/MTS_IO_CellularRadio.cpp') diff --git a/src/MTS_IO_CellularRadio.cpp b/src/MTS_IO_CellularRadio.cpp index 46a3aa9..cd957a9 100644 --- a/src/MTS_IO_CellularRadio.cpp +++ b/src/MTS_IO_CellularRadio.cpp @@ -289,6 +289,9 @@ CellularRadio::CODE CellularRadio::convertModelToMtsShortCode(const std::string& } else if (sModel.find("LE910-NAG") == 0) { sCode = "LAT1"; eCode = SUCCESS; + } else if (sModel.find("LE910-NA1") == 0) { + sCode = "LNA3"; + eCode = SUCCESS; } else if (sModel.find("LE910-SVG") == 0) { sCode = "LVW2"; eCode = SUCCESS; @@ -349,6 +352,9 @@ CellularRadio::CODE CellularRadio::convertModelToType(const std::string& sModel, } else if (sModel.find("LE910-NAG") == 0) { sType = VALUE_TYPE_LTE; eCode = SUCCESS; + } else if (sModel.find("LE910-NA1") == 0) { + sType = VALUE_TYPE_LTE; + eCode = SUCCESS; } else if (sModel.find("LE910-SVG") == 0) { sType = VALUE_TYPE_LTE; eCode = SUCCESS; @@ -1062,12 +1068,14 @@ CellularRadio::CODE CellularRadio::getNetworkStatus(Json::Value& jData) { // // ,,,,,,,[],,,,,,[],, // Ex 2: #RFSTS:"310 410",5780,-105,-73,-14,4603,255,,128,19,0,0000098,"310410536498694","AT&T",3,17 + // #RFSTS:"311 480",1150,-96,-66,-9.0,bf35,FF,0,0,19,1,"2ED1B0E","311480148817753","Verizon",2,2,720000,10800 + // #RFSTS:"310 410",2175,-120,-89,-17.5,4612,FF,0,0,19,1,"4E5E916","310410807276607","AT&T",3,4 // // Additional parameter in the second example shifts the rest of the parameters. Here we are trying to figure out - // which format is currently produced based on field position which always has double quotation marks. + // which format is currently produced based on field position which always has double quotation marks. // - if (vParts[11].find("\"") == std::string::npos) { - // read the RAC and remove it from the vector + if (vParts[13].find("\"") != std::string::npos) { + // parse the RAC and then remove it from the vector jData[KEY_RAC] = vParts[6]; vParts.erase(vParts.begin() + 6); } @@ -1081,7 +1089,7 @@ CellularRadio::CODE CellularRadio::getNetworkStatus(Json::Value& jData) { jData[KEY_DRX] = vParts[7]; jDebug[KEY_MM] = vParts[8]; jDebug["rrc"] = vParts[9]; - jData[KEY_CID] = vParts[10]; + jData[KEY_CID] = MTS::Text::strip(vParts[10], '"'); jData[KEY_IMSI] = MTS::Text::strip(vParts[11], '"'); jData[KEY_NETWORK] = MTS::Text::strip(vParts[12], '"'); @@ -1489,12 +1497,17 @@ CellularRadio::CODE CellularRadio::test(MTS::AutoPtr& apIo, std::string CellularRadio::extractModelFromResult(const std::string& sResult) { std::string sModel(CellularRadio::VALUE_NOT_SUPPORTED); + + printWarning("MYKYTA| ATI4 result: [%s]", sResult.c_str()); + if(sResult.find("HE910-D") != std::string::npos) { sModel = "HE910-D"; } else if(sResult.find("HE910-EUD") != std::string::npos) { sModel = "HE910-EUD"; } else if(sResult.find("LE910-NAG") != std::string::npos) { sModel = "LE910-NAG"; + } else if(sResult.find("LE910-NA1") != std::string::npos) { + sModel = "LE910-NA1"; } else if(sResult.find("LE910-SVG") != std::string::npos) { sModel = "LE910-SVG"; } else if(sResult.find("LE910-EUG") != std::string::npos) { -- cgit v1.2.3