diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/MTS_IO_QuectelRadio.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/MTS_IO_QuectelRadio.cpp b/src/MTS_IO_QuectelRadio.cpp index a9f9721..4d13e7b 100644 --- a/src/MTS_IO_QuectelRadio.cpp +++ b/src/MTS_IO_QuectelRadio.cpp @@ -211,13 +211,15 @@ CellularRadio::CODE QuectelRadio::getNetwork(std::string& sNetwork) { +QENG:"servingcell",<state>,"LTE",<is_tdd>,<mcc>,<mnc>,<cellid>,<pcid>,<earfcn>,<freq_band_ind>,<ul_bandwidth>,<dl_bandwidth>,<tac>,<rsrp>,<rsrq>,<rssi>,<sinr><srxlev> */ CellularRadio::CODE QuectelRadio::getNetworkStatus(Json::Value& jData) { + const std::string RAT_GSM = "GSM"; + const std::string RAT_WCDMA = "WCDMA"; + const std::string RAT_LTE = "LTE"; + int32_t iValue; ACTIVEBAND abnd; SERVICEDOMAIN sd; std::string sValue; - const uint32_t GSM_NETWORK_FORMAT = 27; - const uint32_t WCDMA_NETWORK_FORMAT = 17; - const uint32_t LTE_NETWORK_FORMAT = 18; + std::string sRat; // Radio Access Technology which is currently used printTrace("%s| Get Network Status", getName().c_str()); @@ -260,12 +262,14 @@ CellularRadio::CODE QuectelRadio::getNetworkStatus(Json::Value& jData) { } else { // UE state and Access technology, Quectel-specific information jQuectelDebug["state"] = vParts[1]; - jQuectelDebug["rat"] = vParts[2]; + + sRat = MTS::Text::trim(vParts[2], '"'); + jQuectelDebug["rat"] = sRat; } // +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> // +QENG: [0], [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13],[14],[15], [16], [17],[18],[19], [20], [21], [22], [23], [24], [25], [26] - if (vParts.size() == GSM_NETWORK_FORMAT ) { + if (sRat == RAT_GSM) { //Parse as GSM Network Format jData[ICellularRadio::KEY_MCC] = vParts[3]; jData[ICellularRadio::KEY_MNC] = vParts[4]; @@ -308,7 +312,7 @@ CellularRadio::CODE QuectelRadio::getNetworkStatus(Json::Value& jData) { // +QENG:"servingcell",<state>,"WCDMA",<mcc>,<mnc>,<lac>,<cellid>,<uarfcn>,<psc>,<rac>,<rscp>,<ecio>,<phych>,<sf>,<slot>,<speech_code>,<comMod> // +QENG: [0], [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12],[13], [14], [15], [16] - else if((vParts.size() == WCDMA_NETWORK_FORMAT)) { + else if(sRat == RAT_WCDMA) { //Parse as WCDMA Network Format jData[ICellularRadio::KEY_MCC] = vParts[3]; jData[ICellularRadio::KEY_MNC] = vParts[4]; @@ -347,7 +351,7 @@ CellularRadio::CODE QuectelRadio::getNetworkStatus(Json::Value& jData) { // +QENG:"servingcell",<state>,"LTE",<is_tdd>,<mcc>,<mnc>,<cellid>,<pcid>,<earfcn>,<freq_band_ind>,<ul_bandwidth>,<dl_bandwidth>,<tac>,<rsrp>,<rsrq>,<rssi>,<sinr>,<srxlev> // +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) { + else if(sRat == RAT_LTE) { //Parse as LTE Network Format jQuectelDebug["isTdd"] = vParts[3]; jData[ICellularRadio::KEY_MCC] = vParts[4]; |