summaryrefslogtreecommitdiff
path: root/src/MTS_IO_CellularRadio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/MTS_IO_CellularRadio.cpp')
-rw-r--r--src/MTS_IO_CellularRadio.cpp21
1 files changed, 17 insertions, 4 deletions
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) {
//
// <PLMN>,<EARFCN>,<RSRP>,<RSSI>,<RSRQ>,<TAC>,<RAC>,[<TXPWR>],<DRX>,<MM>,<RRC>,<CID>,<IMSI>,[<NetNameAsc>],<SD>,<ABND>
// 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 <RAC> 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 <IMSI> field position which always has double quotation marks.
+ // which format is currently produced based on <NetNameAsc> 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<MTS::IO::Connection>& 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) {