Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
fix: update from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 12, 2023
1 parent 9600ae4 commit fdbfd9f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/events/modem_module_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ static char *get_evt_type_str(enum modem_module_event_type type)
return "MODEM_EVT_CARRIER_EVENT_LTE_LINK_UP_REQUEST";
case MODEM_EVT_CARRIER_EVENT_LTE_LINK_DOWN_REQUEST:
return "MODEM_EVT_CARRIER_EVENT_LTE_LINK_DOWN_REQUEST";
case MODEM_EVT_CARRIER_EVENT_LTE_POWER_OFF_REQUEST:
return "MODEM_EVT_CARRIER_EVENT_LTE_POWER_OFF_REQUEST";
case MODEM_EVT_CARRIER_FOTA_PENDING:
return "MODEM_EVT_CARRIER_FOTA_PENDING";
case MODEM_EVT_CARRIER_FOTA_STOPPED:
Expand Down
1 change: 1 addition & 0 deletions src/events/modem_module_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ enum modem_module_event_type {
MODEM_EVT_CARRIER_REBOOT_REQUEST,
MODEM_EVT_CARRIER_EVENT_LTE_LINK_UP_REQUEST,
MODEM_EVT_CARRIER_EVENT_LTE_LINK_DOWN_REQUEST,
MODEM_EVT_CARRIER_EVENT_LTE_POWER_OFF_REQUEST
};

/** @brief LTE cell information. */
Expand Down
17 changes: 16 additions & 1 deletion src/modules/modem_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,11 @@ int lwm2m_carrier_event_handler(const lwm2m_carrier_event_t *evt)
SEND_EVENT(modem, MODEM_EVT_CARRIER_EVENT_LTE_LINK_DOWN_REQUEST);
break;
}
case LWM2M_CARRIER_EVENT_LTE_POWER_OFF:
case LWM2M_CARRIER_EVENT_LTE_POWER_OFF: {
LOG_INF("LWM2M_CARRIER_EVENT_LTE_POWER_OFF");
SEND_EVENT(modem, MODEM_EVT_CARRIER_EVENT_LTE_POWER_OFF_REQUEST);
break;
}
case LWM2M_CARRIER_EVENT_BOOTSTRAPPED:
LOG_INF("LWM2M_CARRIER_EVENT_BOOTSTRAPPED");
break;
Expand Down Expand Up @@ -773,6 +775,19 @@ static void on_state_connected(struct modem_msg_data *msg)

state_set(STATE_DISCONNECTED);
}

if (IS_EVENT(msg, modem, MODEM_EVT_CARRIER_EVENT_LTE_POWER_OFF_REQUEST)) {
int err;

err = lte_lc_power_off();
if (err) {
LOG_ERR("LTE power off failed, error: %d", err);
SEND_ERROR(modem, MODEM_EVT_ERROR, err);
return;
}

state_set(STATE_DISCONNECTED);
}
}

/* Message handler for all states. */
Expand Down

0 comments on commit fdbfd9f

Please sign in to comment.