Skip to content

Commit fd864c6

Browse files
ahedin25nashif
authored andcommitted
drivers: modem: hl7800: Allow operation without a SIM card
Allow the driver to run if a SIM card is not present. This allows public HL7800 APIs like firmware updates to be used even if no network is available. Remove duplicate query ICCID command. Signed-off-by: Andrew Hedin <andrew.hedin@lairdconnect.com>
1 parent 89ddd0b commit fd864c6

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/modem/hl7800.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ struct hl7800_iface_ctx {
501501
char mdm_sn[MDM_HL7800_SERIAL_NUMBER_SIZE];
502502
char mdm_network_status[MDM_NETWORK_STATUS_LENGTH];
503503
char mdm_iccid[MDM_HL7800_ICCID_SIZE];
504-
uint8_t mdm_startup_state;
504+
enum mdm_hl7800_startup_state mdm_startup_state;
505505
enum mdm_hl7800_radio_mode mdm_rat;
506506
char mdm_active_bands_string[MDM_HL7800_LTE_BAND_STR_SIZE];
507507
char mdm_bands_string[MDM_HL7800_LTE_BAND_STR_SIZE];
@@ -3693,8 +3693,6 @@ static int modem_boot_handler(char *reason)
36933693
LOG_ERR("Err waiting for boot: %d, DSR: %u", ret,
36943694
ictx.dsr_state);
36953695
return -1;
3696-
} else if (ictx.mdm_startup_state != HL7800_STARTUP_STATE_READY) {
3697-
return -1;
36983696
} else {
36993697
LOG_INF("Modem booted!");
37003698
}
@@ -4028,7 +4026,7 @@ static int modem_reset_and_configure(void)
40284026
SEND_COMPLEX_AT_CMD("AT+KGSN=3");
40294027

40304028
/* query SIM ICCID */
4031-
SEND_AT_CMD_EXPECT_OK("AT+CCID?");
4029+
SEND_AT_CMD_IGNORE_ERROR("AT+CCID?");
40324030

40334031
/* An empty string is used here so that it doesn't conflict
40344032
* with the APN used in the +CGDCONT command.
@@ -4079,7 +4077,6 @@ static int modem_reset_and_configure(void)
40794077
LOG_ERR("Unable to configure modem");
40804078
ictx.configured = false;
40814079
set_network_state(HL7800_UNABLE_TO_CONFIGURE);
4082-
modem_reset();
40834080
/* Kernel will fault with non-zero return value.
40844081
* Allow other parts of application to run when modem cannot be configured.
40854082
*/

0 commit comments

Comments
 (0)