diff options
author | Serhii Kostiuk <serhii.o.kostiuk@globallogic.com> | 2019-06-11 18:24:23 +0300 |
---|---|---|
committer | Serhii Kostiuk <serhii.o.kostiuk@globallogic.com> | 2019-06-11 18:24:23 +0300 |
commit | 2dad34c7a24430ed8c55079405e2988d5a35cd87 (patch) | |
tree | d836bf06f2145304986e5cec32b21227909d8159 /src | |
parent | 20471af5d887ab2255716c734661abb95953676c (diff) | |
download | libmts-io-2dad34c7a24430ed8c55079405e2988d5a35cd87.tar.gz libmts-io-2dad34c7a24430ed8c55079405e2988d5a35cd87.tar.bz2 libmts-io-2dad34c7a24430ed8c55079405e2988d5a35cd87.zip |
[MTS-MTQ] QuectelRadio implementation
Modified QuectelRadio::getNetworkStatus to populate Quectel-specific debug information.
Added as a separate commit for simple reverts
Diffstat (limited to 'src')
-rw-r--r-- | src/MTS_IO_QuectelRadio.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/MTS_IO_QuectelRadio.cpp b/src/MTS_IO_QuectelRadio.cpp index 597bdac..3f108e6 100644 --- a/src/MTS_IO_QuectelRadio.cpp +++ b/src/MTS_IO_QuectelRadio.cpp @@ -237,11 +237,16 @@ CellularRadio::CODE QuectelRadio::getNetworkStatus(Json::Value& jData) { size_t start = sResult.find(":") + 1; //Position right after "+QENG:" std::vector<std::string> vParts = MTS::Text::split(MTS::Text::trim(sResult.substr(start)), ","); Json::Value jDebug; + Json::Value jQuectelDebug; if (vParts.size() < 3) { printDebug("%s| Network Status command reponse is an unknown format: [%s][%s]", getName().c_str(), sCmd.c_str(), sResult.c_str()); printTrace("%s| Network Status:\n%s\n", getName().c_str(), jData.toStyledString().c_str()); return SUCCESS; //return SUCCESS because getCommonNetworkStats() succeeded at top of this function + } else { + // UE state and Access technology, Quectel-specific information + jQuectelDebug["state"] = vParts[1]; + jQuectelDebug["rat"] = vParts[2]; } // +QENG:"servingscell",<state>,"GSM",<mcc>,<mnc>,<lac>,<cellid>,<bsic>,<arfcn>,<band>,<rxlev>,<txp>,<rla>,<drx>,<c1>,<c2>,<gprs>,<tch>,<ts>,<ta>,<maio>,<hsn>,<rxlevsub>,<rxlevfull>,<rxqualsub>,<rxqualfull>,<voicecodec> @@ -252,6 +257,7 @@ CellularRadio::CODE QuectelRadio::getNetworkStatus(Json::Value& jData) { jData[KEY_MNC] = vParts[4]; jData[KEY_LAC] = vParts[5]; jData[KEY_CID] = vParts[6]; + jQuectelDebug["bsic"] = vParts[7]; jData[KEY_CHANNEL] = vParts[8]; if (convertToActiveBand(vParts[9], abnd) == SUCCESS && convertActiveBandToString(abnd, sValue) == SUCCESS) { @@ -266,9 +272,25 @@ CellularRadio::CODE QuectelRadio::getNetworkStatus(Json::Value& jData) { } jData[KEY_TXPWR] = vParts[11]; + jQuectelDebug["rla"] = vParts[12]; + jQuectelDebug["drx"] = vParts[13]; + jQuectelDebug["c1"] = vParts[14]; + jQuectelDebug["c2"] = vParts[15]; + jQuectelDebug["gprs"] = vParts[16]; + jQuectelDebug["tch"] = vParts[17]; + jQuectelDebug["ts"] = vParts[18]; + jQuectelDebug["ta"] = vParts[19]; + jQuectelDebug["maio"] = vParts[20]; + jQuectelDebug["hsn"] = vParts[21]; + jQuectelDebug["rxlevsub"] = vParts[22]; + jQuectelDebug["rxlevfull"] = vParts[23]; + jQuectelDebug["rxqualsub"] = vParts[24]; + jQuectelDebug["rxqualfull"] = vParts[25]; + jQuectelDebug["voicecodec"] = vParts[26]; // The following fields can NOT be fetched for Quectel in GSM mode: RAC, MM, RR, NOM + jData["quectelDebug"] = jQuectelDebug; jData[KEY_DEBUG] = jDebug; } @@ -285,6 +307,11 @@ CellularRadio::CODE QuectelRadio::getNetworkStatus(Json::Value& jData) { jData[KEY_RAC] = vParts[9]; jDebug[KEY_RSCP] = vParts[10]; jDebug[KEY_ECIO] = vParts[11]; + jQuectelDebug["phych"] = vParts[12]; + jQuectelDebug["sf"] = vParts[13]; + jQuectelDebug["slot"] = vParts[14]; + jQuectelDebug["speechCode"] = vParts[15]; + jQuectelDebug["comMod"] = vParts[16]; // The following fields can NOT be fetched for Quectel in WCDMA mode: TXPWR, DRX, MM, RR, NOM, BLER @@ -297,6 +324,7 @@ CellularRadio::CODE QuectelRadio::getNetworkStatus(Json::Value& jData) { RadioBandMap radioBandMap(vParts[7], CellularRadio::VALUE_TYPE_CDMA); jData[KEY_ABND] = radioBandMap.getRadioBandName(); + jData["quectelDebug"] = jQuectelDebug; jData[KEY_DEBUG] = jDebug; } @@ -304,14 +332,21 @@ CellularRadio::CODE QuectelRadio::getNetworkStatus(Json::Value& jData) { // +QENG: [0], [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [14], [15], [16], [17] else if(vParts.size() == LTE_NETWORK_FORMAT) { //Parse as LTE Network Format + jQuectelDebug["isTdd"] = vParts[3]; jData[KEY_MCC] = vParts[4]; jData[KEY_MNC] = vParts[5]; jData[KEY_CID] = vParts[6]; + jQuectelDebug["pcid"] = vParts[7]; jData[KEY_CHANNEL] = vParts[8]; + jQuectelDebug["freqBandInd"] = vParts[9]; + jQuectelDebug["ulBandwidth"] = vParts[10]; + jQuectelDebug["dlBandwidth"] = vParts[11]; jData["tac"] = vParts[12]; jDebug["rsrp"] = vParts[13]; jDebug["rsrq"] = vParts[14]; jData[KEY_RSSIDBM] = vParts[15]; + jQuectelDebug["sinr"] = vParts[16]; + jQuectelDebug["srxlev"] = vParts[17]; // Get the radio band given the channel (EARFCN) RadioBandMap radioBandMap(vParts[8], CellularRadio::VALUE_TYPE_LTE); @@ -320,6 +355,7 @@ CellularRadio::CODE QuectelRadio::getNetworkStatus(Json::Value& jData) { // LAC is not provided by AT+QENG in WCDMA mode. Use another command instead jData[KEY_LAC] = queryLteLac(); + jData["quectelDebug"] = jQuectelDebug; jData[KEY_DEBUG] = jDebug; } |