summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeff Hatch <jhatch@multitech.com>2020-08-25 08:41:40 -0500
committerJeff Hatch <jhatch@multitech.com>2020-08-25 08:41:40 -0500
commit89f84b81da3b94e9b099debbe63b87b85e5697b6 (patch)
tree4a87b34da4ab25b830b0d4a41247116af0a38ecf /src
parentd154933f6a6220e7298260d5084f6516806406b6 (diff)
parentde5833a550219988ab4becc6f75841ecde38096b (diff)
downloadlibmts-io-89f84b81da3b94e9b099debbe63b87b85e5697b6.tar.gz
libmts-io-89f84b81da3b94e9b099debbe63b87b85e5697b6.tar.bz2
libmts-io-89f84b81da3b94e9b099debbe63b87b85e5697b6.zip
Merge branch 'sk/IN4046-mng2-cell-mode-fix' into 'master' 1.0.22
[IN:4046] MTR-MNG2 Dashboard has blank Cellular Mode. See merge request !34
Diffstat (limited to 'src')
-rw-r--r--src/MTS_IO_CellularRadio.cpp34
1 files changed, 25 insertions, 9 deletions
diff --git a/src/MTS_IO_CellularRadio.cpp b/src/MTS_IO_CellularRadio.cpp
index ce95929..fe252c0 100644
--- a/src/MTS_IO_CellularRadio.cpp
+++ b/src/MTS_IO_CellularRadio.cpp
@@ -848,16 +848,32 @@ ICellularRadio::CODE CellularRadio::getCellularMode(CELLULAR_MODES &networks) {
printError("%s| AT+COPS Error parsing reply [AT+COPS?][%s]", getName().c_str(), cmdResult.c_str());
return FAILURE;
}
- if (op == 0) {
- networks = CELLULAR_MODE_2G;
- } else if (op >= 2 && op <= 6) {
- networks = CELLULAR_MODE_3G;
- } else if (op == 7) {
- networks = CELLULAR_MODE_4G;
- } else {
- printError("%s| AT+COPS unknown Radio Access Technology [AT+COPS?][%s]", getName().c_str(), cmdResult.c_str());
- return FAILURE;
+
+ switch (op) {
+ case 0: // GSM
+ case 1: // GSM Compact
+ case 3: // GSM w/EGPRS
+ networks = CELLULAR_MODE_2G;
+ break;
+
+ case 2: // UTRAN
+ case 4: // UTRAN w/HSDPA
+ case 5: // UTRAN w/HSUPA
+ case 6: // UTRAN w/HSDPA and HSUPA
+ networks = CELLULAR_MODE_3G;
+ break;
+
+ case 7: // E-UTRAN, LTE
+ case 8: // CAT M1, EC-GSM-IoT (A/Gb mode), LTE
+ case 9: // NB IoT, E-UTRAN (NB-S1 mode), LTE
+ networks = CELLULAR_MODE_4G;
+ break;
+
+ default:
+ printError("%s| AT+COPS unknown Radio Access Technology [AT+COPS?][%s]", getName().c_str(), cmdResult.c_str());
+ return FAILURE;
}
+
return SUCCESS;
}