From acb40ca0033a48cedfeb118dcc216f60e4dd8c45 Mon Sep 17 00:00:00 2001 From: Serhii Kostiuk Date: Wed, 12 Jun 2019 17:23:03 +0300 Subject: [MTS-MTQ] QuectelRadio implementation Fixed parsing of RSSI dBm in QuectelRadio::getNetworkStatus for GSM mode. As stated in the datasheet[1], we should substract "111" from the value in field in order to get a proper value in dBm. The thing is that the values returned by a real device are already out of the "0-63" range stated in a datasheet. And looks like those values are already in a dBm scale. [2] This commit removes additional substraction and saves the value of field directly without any modifications. Sources: - [1] QuectelEC2x26EG9x26EM05QuecCellATCommandsManualV10.929966385.pdf, page 9, field description. - [2] +QENG: "servingcell","NOCONN","GSM",REDACTED,REDACTED,REFACTED,REDACTED,8,522,0,-66,255,255,0,41,41,1,-,-,-,-,-,-,-,-,-,"" --- src/MTS_IO_QuectelRadio.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/MTS_IO_QuectelRadio.cpp b/src/MTS_IO_QuectelRadio.cpp index 20a2a21..af7fc7c 100644 --- a/src/MTS_IO_QuectelRadio.cpp +++ b/src/MTS_IO_QuectelRadio.cpp @@ -273,13 +273,7 @@ CellularRadio::CODE QuectelRadio::getNetworkStatus(Json::Value& jData) { jData[KEY_ABND] = sValue; } - if (MTS::Text::parse(iValue, vParts[10])) { - // Number format. RX level value for base station selection in dB (see 3GPP 25.304). - // Range: 0-63. Subtracting 111 from the RX level value, a dBm value will be got. - int rssi = iValue - 111; - jData[KEY_RSSIDBM] = MTS::Text::format(rssi); - } - + jData[KEY_RSSIDBM] = vParts[10]; // Values already negative. No need to substract 111 as stated in a datasheet jData[KEY_TXPWR] = vParts[11]; jQuectelDebug["rla"] = vParts[12]; jQuectelDebug["drx"] = vParts[13]; -- cgit v1.2.3