summaryrefslogtreecommitdiff
path: root/src/MTS_IO_QuectelRadio.cpp
diff options
context:
space:
mode:
authorSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2019-07-18 11:59:02 +0300
committerSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2019-07-18 12:04:38 +0300
commitebfa95037a98d785029dc9afe8e4aafd8c81b843 (patch)
treede3db0013e9cfea90f258f3ab3f9cb2b6ee84b9b /src/MTS_IO_QuectelRadio.cpp
parent60f4460b88b7c72f738dba47843961076c21ab9a (diff)
downloadlibmts-io-ebfa95037a98d785029dc9afe8e4aafd8c81b843.tar.gz
libmts-io-ebfa95037a98d785029dc9afe8e4aafd8c81b843.tar.bz2
libmts-io-ebfa95037a98d785029dc9afe8e4aafd8c81b843.zip
[MTS-MTQ] QuectelRadio implementation
Now using "<rat>" field instead on number of fields returned in "AT+QENG" result for the QuectelRadio::getNetworkStatus implementation. This change was implemented after a code review.
Diffstat (limited to 'src/MTS_IO_QuectelRadio.cpp')
-rw-r--r--src/MTS_IO_QuectelRadio.cpp18
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];