modem: hl7800: do not query SIM if not present

Do not query SIM card parameters if the SIM
card is not present.
This shortens the driver initialization time
significantly if a SIM card is not present.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
This commit is contained in:
Ryan Erickson 2022-04-14 14:29:35 -05:00 committed by Maureen Helm
commit b8aa44ec46

View file

@ -5316,12 +5316,14 @@ reboot:
/* query modem serial number */ /* query modem serial number */
SEND_COMPLEX_AT_CMD("AT+KGSN=3"); SEND_COMPLEX_AT_CMD("AT+KGSN=3");
/* query SIM ICCID */ if (ictx.mdm_startup_state != HL7800_STARTUP_STATE_SIM_NOT_PRESENT) {
SEND_AT_CMD_IGNORE_ERROR("AT+CCID?"); /* query SIM ICCID */
SEND_AT_CMD_IGNORE_ERROR("AT+CCID?");
/* query SIM IMSI */ /* query SIM IMSI */
(void)send_at_cmd(NULL, "AT+CIMI", MDM_CMD_SEND_TIMEOUT, (void)send_at_cmd(NULL, "AT+CIMI", MDM_CMD_SEND_TIMEOUT, MDM_DEFAULT_AT_CMD_RETRIES,
MDM_DEFAULT_AT_CMD_RETRIES, true); true);
}
/* Query PDP context to get APN */ /* Query PDP context to get APN */
SEND_AT_CMD_EXPECT_OK("AT+CGDCONT?"); SEND_AT_CMD_EXPECT_OK("AT+CGDCONT?");