Skip to content

Commit d83aaef

Browse files
rerickson1nashif
authored andcommitted
drivers: modem: hl7800: Add retries to get IP address info
Allow command retries when querying IP address info. Signed-off-by: Ryan Erickson <[email protected]>
1 parent 885e830 commit d83aaef

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

drivers/modem/Kconfig.hl7800

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,4 +265,8 @@ config MODEM_HL7800_INIT_PRIORITY
265265
Note that the priority needs to be lower than the net stack
266266
so that it can start before the networking sub-system.
267267

268+
config MODEM_HL7800_GET_IP_ADDR_INFO_ATTEMPTS
269+
int "Number of attempts to get IP address info during init"
270+
default 4
271+
268272
endif # MODEM_HL7800

drivers/modem/hl7800.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2320,7 +2320,8 @@ static void iface_status_work_cb(struct k_work *work)
23202320
} else if (ictx.iface && net_if_is_up(ictx.iface)) {
23212321
hl7800_start_rssi_work();
23222322
/* get IP address info */
2323-
SEND_AT_CMD_IGNORE_ERROR("AT+CGCONTRDP=1");
2323+
(void)send_at_cmd(NULL, "AT+CGCONTRDP=1", MDM_CMD_SEND_TIMEOUT,
2324+
CONFIG_MODEM_HL7800_GET_IP_ADDR_INFO_ATTEMPTS, false);
23242325
/* get active bands */
23252326
SEND_AT_CMD_IGNORE_ERROR("AT+KBND?");
23262327
}

0 commit comments

Comments
 (0)