From 9a78ce7478a507337bc78967e7ed244c5179b45c Mon Sep 17 00:00:00 2001 From: Serhii Kostiuk Date: Tue, 12 May 2020 12:06:38 +0300 Subject: [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. --- src/MTS_IO_CellularRadio.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/MTS_IO_CellularRadio.cpp') 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; } -- cgit v1.2.3