summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2020-05-12 12:06:38 +0300
committerSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2020-05-12 12:08:57 +0300
commit9a78ce7478a507337bc78967e7ed244c5179b45c (patch)
treec05ea36e404164039b190d96f2b8446c5b017d24 /src
parentf3c24e90ea78d45e995e048a2c60ab828995fd3f (diff)
downloadlibmts-io-9a78ce7478a507337bc78967e7ed244c5179b45c.tar.gz
libmts-io-9a78ce7478a507337bc78967e7ed244c5179b45c.tar.bz2
libmts-io-9a78ce7478a507337bc78967e7ed244c5179b45c.zip
[IN:4033] MTCDTIP-L4N1 does not provide No SIM message.
Allowed to interpret "AT+CPIN: ERROR" as "SIM card not detected" for cases when something is inserted in the SIM card slot but the SIM card itself is either removed, damaged or not responding for some other reason.
Diffstat (limited to 'src')
-rw-r--r--src/MTS_IO_CellularRadio.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/MTS_IO_CellularRadio.cpp b/src/MTS_IO_CellularRadio.cpp
index 191299b..50fdf5c 100644
--- a/src/MTS_IO_CellularRadio.cpp
+++ b/src/MTS_IO_CellularRadio.cpp
@@ -306,7 +306,7 @@ ICellularRadio::CODE CellularRadio::getSimStatusSummary(Json::Value& jData) {
}
if (!bIsSimInserted) {
- // There is no left much to do. Return one field only.
+ // There is not much left to do. Return one field only.
jData[KEY_IS_SIM_INSERTED] = bIsSimInserted;
break;
}
@@ -314,6 +314,16 @@ ICellularRadio::CODE CellularRadio::getSimStatusSummary(Json::Value& jData) {
// The following code assumes that the SIM card is inserted
retCode = getSimLockStatus(sSimLockStatus);
if (retCode != SUCCESS) {
+ /* IN:4033:
+ *
+ * On some devices #SIMDET reports "inserted" but +CPIN? returns ERROR when there is
+ * no SIM card in the slot. It's also the case when only plastic holder is inserted
+ * instead of the SIM itself.
+ *
+ * Interpret this error as "SIM card not detected" for such cases.
+ */
+ jData[KEY_IS_SIM_INSERTED] = false;
+ retCode = SUCCESS;
break;
}