drivers: modem: gsm: add handler for +CME ERROR
The driver enabled extended error code (AT+CMEE=1) during setup but is missing a handler for the +CME ERROR, fix that. Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
This commit is contained in:
parent
60beb291df
commit
e15f6f121f
1 changed files with 11 additions and 3 deletions
|
@ -171,9 +171,19 @@ MODEM_CMD_DEFINE(gsm_cmd_error)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* Handler: +CME Error: <err>[0] */
|
||||
MODEM_CMD_DEFINE(gsm_cmd_exterror)
|
||||
{
|
||||
/* TODO: map extended error codes to values */
|
||||
modem_cmd_handler_set_error(data, -EIO);
|
||||
k_sem_give(&gsm.sem_response);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct modem_cmd response_cmds[] = {
|
||||
MODEM_CMD("OK", gsm_cmd_ok, 0U, ""),
|
||||
MODEM_CMD("ERROR", gsm_cmd_error, 0U, ""),
|
||||
MODEM_CMD("+CME ERROR: ", gsm_cmd_exterror, 1U, ""),
|
||||
MODEM_CMD("CONNECT", gsm_cmd_ok, 0U, ""),
|
||||
};
|
||||
|
||||
|
@ -429,12 +439,10 @@ static const struct setup_cmd setup_cmds[] = {
|
|||
SETUP_CMD_NOHANDLE("ATE0"),
|
||||
/* hang up */
|
||||
SETUP_CMD_NOHANDLE("ATH"),
|
||||
/* extender errors in numeric form */
|
||||
/* extended errors in numeric form */
|
||||
SETUP_CMD_NOHANDLE("AT+CMEE=1"),
|
||||
|
||||
/* disable unsolicited network registration codes */
|
||||
SETUP_CMD_NOHANDLE("AT+CREG=0"),
|
||||
|
||||
/* create PDP context */
|
||||
SETUP_CMD_NOHANDLE("AT+CGDCONT=1,\"IP\",\"" CONFIG_MODEM_GSM_APN "\""),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue