Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: modem: introducing config for cereg/creg for gsm #64025

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions drivers/modem/Kconfig.gsm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,25 @@ config MODEM_GSM_QUECTEL

endchoice

choice MODEM_GSM_STATUS_COMMAND
prompt "Select status command Type"
default MODEM_GSM_STATUS_CMD_USE_CREG
help
Use particular type of AT command for cell tower registration status.

config MODEM_GSM_STATUS_CMD_USE_CREG
bool "CREG command"

config MODEM_GSM_STATUS_CMD_USE_CEREG
bool "CEREG command"

endchoice

config MODEM_GSM_STATUS_COMMAND
string "Status Command"
default "CREG" if MODEM_GSM_STATUS_CMD_USE_CREG
default "CEREG" if MODEM_GSM_STATUS_CMD_USE_CEREG

config MODEM_GSM_RX_STACK_SIZE
int "Size of the stack allocated for receiving data from modem"
default 512
Expand Down
4 changes: 2 additions & 2 deletions drivers/modem/gsm_ppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ static const struct modem_cmd read_cops_cmd =
MODEM_CMD_ARGS_MAX("+COPS:", on_cmd_atcmdinfo_cops, 1U, 4U, ",");

static const struct modem_cmd check_net_reg_cmd =
MODEM_CMD("+CREG: ", on_cmd_net_reg_sts, 2U, ",");
MODEM_CMD("+" CONFIG_MODEM_GSM_STATUS_COMMAND, on_cmd_net_reg_sts, 2U, ",");

static const struct modem_cmd check_attached_cmd =
MODEM_CMD("+CGATT:", on_cmd_atcmdinfo_attached, 1U, ",");
Expand Down Expand Up @@ -751,7 +751,7 @@ static void gsm_finalize_connection(struct k_work *work)
ret = modem_cmd_send_nolock(&gsm->context.iface,
&gsm->context.cmd_handler,
&check_net_reg_cmd, 1,
"AT+CREG?",
"AT+" CONFIG_MODEM_GSM_STATUS_COMMAND "?",
&gsm->sem_response,
GSM_CMD_SETUP_TIMEOUT);
if ((ret < 0) || ((gsm->net_state != GSM_NET_ROAMING) &&
Expand Down
Loading