summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYevhen Mykhno <yevhen.mykhno@globallogic.com>2023-02-01 14:05:14 +0200
committerJohn Klug <john.klug@multitech.com>2023-03-13 10:58:39 -0500
commitb3abb0d073b7484c6e4838a8ad13135e54e79d46 (patch)
treeeaf317005efd6f2b1c4733aec3ffeb4ac3531152
parent113c27acee44b64c14757ec79c4abe7b1b10582f (diff)
downloadlibmts-io-b3abb0d073b7484c6e4838a8ad13135e54e79d46.tar.gz
libmts-io-b3abb0d073b7484c6e4838a8ad13135e54e79d46.tar.bz2
libmts-io-b3abb0d073b7484c6e4838a8ad13135e54e79d46.zip
[GP-1733] mPower R.6: L6G1 (Sequans CB610L) Radio Support
- the function getNetworkStatus(Json::Value& jData) changed to follow common logic (jDebug is empty when the main status command is failed) - removed unnecessary prints from the secondary status commands
-rw-r--r--src/MTS_IO_SequansRadio.cpp24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/MTS_IO_SequansRadio.cpp b/src/MTS_IO_SequansRadio.cpp
index f3b32fb..0e909b8 100644
--- a/src/MTS_IO_SequansRadio.cpp
+++ b/src/MTS_IO_SequansRadio.cpp
@@ -193,7 +193,6 @@ ICellularRadio::CODE SequansRadio::getNetworkStatusSQN(Json::Value& jData, Json:
rc = sendBasicQuery(sCmd, sPrefix, sResult, 200);
if (SUCCESS != rc) {
printDebug("%s| Network Status command returned unexpected response: [%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 rc;
}
@@ -232,7 +231,6 @@ ICellularRadio::CODE SequansRadio::getNetworkStatusSignal(Json::Value& jData, Js
rc = sendBasicQuery(sCmd, sPrefix, sResult, 200);
if (SUCCESS != rc) {
printDebug("%s| Network Status command returned unexpected response: [%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 rc;
}
@@ -242,7 +240,6 @@ ICellularRadio::CODE SequansRadio::getNetworkStatusSignal(Json::Value& jData, Js
if (vParts.size() < 6) {
printDebug("%s| Network Status command response 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 FAILURE;
}
@@ -254,7 +251,6 @@ ICellularRadio::CODE SequansRadio::getNetworkStatusSignal(Json::Value& jData, Js
}
if (iValue > 97 || iValue < 0) {
printDebug("%s| Network Status command returned unexpected value of RSRP: [%s][%d]", getName().c_str(), sCmd.c_str(), iValue);
- printTrace("%s| Network Status:\n%s\n", getName().c_str(), jData.toStyledString().c_str());
break;
}
// converting value to rsrp dBm according to documentation
@@ -269,7 +265,6 @@ ICellularRadio::CODE SequansRadio::getNetworkStatusSignal(Json::Value& jData, Js
}
if (iValue > 34 || iValue < 0) {
printDebug("%s| Network Status command returned unexpected value of RSRQ: [%s][%d]", getName().c_str(), sCmd.c_str(), iValue);
- printTrace("%s| Network Status:\n%s\n", getName().c_str(), jData.toStyledString().c_str());
break;
}
// converting value to rsrq in dBm according to documentation
@@ -299,7 +294,6 @@ ICellularRadio::CODE SequansRadio::getNetworkStatusTxPower(Json::Value& jData, J
rc = sendBasicQuery(sCmd, sPrefix, sResult, 200);
if (SUCCESS != rc) {
printDebug("%s| Network Status command returned unexpected response: [%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 rc;
}
// <txPower>,<maxTxPower>
@@ -308,7 +302,6 @@ ICellularRadio::CODE SequansRadio::getNetworkStatusTxPower(Json::Value& jData, J
if (vParts.size() < 2) {
printDebug("%s| Network Status command response 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 FAILURE;
}
@@ -320,7 +313,6 @@ ICellularRadio::CODE SequansRadio::getNetworkStatusTxPower(Json::Value& jData, J
}
if (fTxPow < -255 || fTxPow > 99) {
printDebug("%s| Network Status command returned unexpected value of txPower: [%s][%d]", getName().c_str(), sCmd.c_str(), iValue);
- printTrace("%s| Network Status:\n%s\n", getName().c_str(), jData.toStyledString().c_str());
break;
}
jDebug[ICellularRadio::KEY_TXPWR] = vParts[0];
@@ -337,16 +329,13 @@ ICellularRadio::CODE SequansRadio::getNetworkStatus(Json::Value& jData) {
Json::Value jDebug;
std::string sResult;
+ CODE rcMainStatus;
getCommonNetworkStats(jData);
- getNetworkStatusSQN(jData, jDebug);
+ rcMainStatus = getNetworkStatusSQN(jData, jDebug);
getNetworkStatusSignal(jData, jDebug);
getNetworkStatusTxPower(jData, jDebug);
- if (jData.isMember(ICellularRadio::KEY_RSSIDBM)) {
- jDebug[ICellularRadio::KEY_RSSIDBM] = jData[ICellularRadio::KEY_RSSIDBM];
- }
-
if (SUCCESS == getImsi(sResult)) {
jData[ICellularRadio::KEY_IMSI] = sResult;
}
@@ -355,9 +344,12 @@ ICellularRadio::CODE SequansRadio::getNetworkStatus(Json::Value& jData) {
jData[ICellularRadio::KEY_NETWORK] = sResult;
}
- jDebug[ICellularRadio::KEY_SD] = "PS";
-
- jData[ICellularRadio::KEY_DEBUG] = jDebug;
+ // Fill the debug information only if the main tower information was fetched successfully.
+ if (SUCCESS == rcMainStatus) {
+ jDebug[ICellularRadio::KEY_RSSIDBM] = jData[ICellularRadio::KEY_RSSIDBM];
+ jDebug[ICellularRadio::KEY_SD] = "PS";
+ jData[ICellularRadio::KEY_DEBUG] = jDebug;
+ }
printTrace("%s| Network Status:\n%s\n", getName().c_str(), jData.toStyledString().c_str());
return SUCCESS;