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

lib: nrf_modem_lib: lte_net_if: Add handling of reset loop event #13507

Merged
merged 1 commit into from
Jan 18, 2024
Merged
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
50 changes: 27 additions & 23 deletions lib/nrf_modem_lib/lte_net_if/lte_net_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,29 +302,33 @@ static void pdn_event_handler(uint8_t cid, enum pdn_event event, int reason)

static void lte_reg_handler(const struct lte_lc_evt *const evt)
{
if (evt->type != LTE_LC_EVT_NW_REG_STATUS) {
return;
}

switch (evt->nw_reg_status) {
case LTE_LC_NW_REG_REGISTERED_HOME:
__fallthrough;
case LTE_LC_NW_REG_REGISTERED_ROAMING:
/* Mark serving cell as available. */
LOG_DBG("Registered to serving cell");
update_has_cell(true);
break;
case LTE_LC_NW_REG_SEARCHING:
/* Searching for a new cell, do not consider this cell loss unless it
* fails (which will generate a new LTE_LC_EVT_NW_REG_STATUS event with
* an unregistered status).
*/
break;
default:
LOG_DBG("Not registered to serving cell");
/* Mark the serving cell as lost. */
update_has_cell(false);
break;
if (evt->type == LTE_LC_EVT_MODEM_EVENT && evt->modem_evt == LTE_LC_MODEM_EVT_RESET_LOOP) {
LOG_WRN("The modem has detected a reset loop. LTE network attach is now "
"restricted for the next 30 minutes.");

LOG_DBG("For more information, see the AT command documentation "
"for the %%MDMEV notification");
} else if (evt->type == LTE_LC_EVT_NW_REG_STATUS) {
switch (evt->nw_reg_status) {
case LTE_LC_NW_REG_REGISTERED_HOME:
__fallthrough;
case LTE_LC_NW_REG_REGISTERED_ROAMING:
/* Mark serving cell as available. */
LOG_DBG("Registered to serving cell");
update_has_cell(true);
break;
case LTE_LC_NW_REG_SEARCHING:
/* Searching for a new cell, do not consider this cell loss unless it
* fails (which will generate a new LTE_LC_EVT_NW_REG_STATUS event with
* an unregistered status).
*/
break;
default:
LOG_DBG("Not registered to serving cell");
/* Mark the serving cell as lost. */
update_has_cell(false);
break;
}
}
}

Expand Down
Loading