summaryrefslogtreecommitdiff
path: root/src/MTS_IO_CellularRadio.cpp
diff options
context:
space:
mode:
authorSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2020-08-19 19:43:22 +0300
committerSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2020-08-19 19:49:58 +0300
commitde5833a550219988ab4becc6f75841ecde38096b (patch)
tree4a87b34da4ab25b830b0d4a41247116af0a38ecf /src/MTS_IO_CellularRadio.cpp
parentd154933f6a6220e7298260d5084f6516806406b6 (diff)
downloadlibmts-io-de5833a550219988ab4becc6f75841ecde38096b.tar.gz
libmts-io-de5833a550219988ab4becc6f75841ecde38096b.tar.bz2
libmts-io-de5833a550219988ab4becc6f75841ecde38096b.zip
[IN:4046] MTR-MNG2 Dashboard has blank Cellular Mode.
This commit contains the following changes: - mark all GSM modes as 2G (EGPRS/EDGE is also 2G/GSM); - mark NB-IoT and CAT M1 as 4G/LTE. Those changes allow to correctly display 4G modes for MNG2 and 2G modes for all radios.
Diffstat (limited to 'src/MTS_IO_CellularRadio.cpp')
-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;
}