Skip to content

Commit ba88cf3

Browse files
committed
modem_cellular: simcom a76xx: add shutdown script
Add a shutdown script to the a76xx modem driver. Signed-off-by: Olivier Lalonde <o@syskall.com>
1 parent 1b299d7 commit ba88cf3

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

drivers/modem/modem_cellular.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2112,6 +2112,14 @@ MODEM_CHAT_SCRIPT_CMDS_DEFINE(simcom_a76xx_periodic_chat_script_cmds,
21122112
MODEM_CHAT_SCRIPT_DEFINE(simcom_a76xx_periodic_chat_script,
21132113
simcom_a76xx_periodic_chat_script_cmds, abort_matches,
21142114
modem_cellular_chat_callback_handler, 4);
2115+
2116+
MODEM_CHAT_SCRIPT_CMDS_DEFINE(simcom_a76xx_shutdown_chat_script_cmds,
2117+
MODEM_CHAT_SCRIPT_CMD_RESP("AT+CPOF", ok_match));
2118+
2119+
MODEM_CHAT_SCRIPT_DEFINE(simcom_a76xx_shutdown_chat_script,
2120+
simcom_a76xx_shutdown_chat_script_cmds, abort_matches,
2121+
modem_cellular_chat_callback_handler, 15);
2122+
21152123
#endif
21162124

21172125
#if DT_HAS_COMPAT_STATUS_OKAY(u_blox_sara_r4)
@@ -2617,7 +2625,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script,
26172625
&simcom_sim7080_dial_chat_script, \
26182626
&simcom_sim7080_periodic_chat_script, NULL)
26192627

2620-
#define MODEM_CELLULAR_DEVICE_SIMCOM_A76XX(inst) \
2628+
#define MODEM_CELLULAR_DEVICE_SIMCOM_A76XX(inst) \
26212629
MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \
26222630
\
26232631
static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \
@@ -2632,9 +2640,10 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script,
26322640
\
26332641
MODEM_CELLULAR_DEFINE_INSTANCE(inst, 500, 100, 20000, 5000, false, \
26342642
NULL, \
2635-
&simcom_a76xx_init_chat_script, \
2636-
&simcom_a76xx_dial_chat_script, \
2637-
&simcom_a76xx_periodic_chat_script, NULL)
2643+
&simcom_a76xx_init_chat_script, \
2644+
&simcom_a76xx_dial_chat_script, \
2645+
&simcom_a76xx_periodic_chat_script, \
2646+
&simcom_a76xx_shutdown_chat_script)
26382647

26392648
#define MODEM_CELLULAR_DEVICE_U_BLOX_SARA_R4(inst) \
26402649
MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \

0 commit comments

Comments
 (0)