nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches

◆ lwm2m_firmware_event_cb_t

typedef int(* lwm2m_firmware_event_cb_t) (struct lwm2m_fota_event *event)

#include <include/net/lwm2m_client_utils.h>

Firmware update event callback.

Parameters
[in]eventLwM2M Firmware Update object event structure

This callback is used for indicating firmware update states, to prepare the application for an update, and to request for reconnecting the modem after the firmware update.

Event handler is getting event callback when Firmware update utils library change states.

LWM2M_FOTA_DOWNLOAD_START: Indicate that download or upload of a new image is started.

LWM2M_FOTA_DOWNLOAD_FINISHED: Indicate that Image is delivered.

LWM2M_FOTA_UPDATE_IMAGE_REQ: Request a permission to update an image. Callback handler may return zero to grant permission for update. Otherwise it may return negative error code to cancel the update or positive value to indicate that update should be postponed that amount of seconds.

LWM2M_FOTA_UPDATE_MODEM_RECONNECT_REQ: Request a reconnect and initialize the modem after a firmware update. The callback handler may return 0 to indicate that the application is handling the reconnect. Modem initialization and LwM2M client re-connection needs to be handled outside of the callback context. Otherwise, return -1 to indicate that the device is rebooting

LWM2M_FOTA_UPDATE_ERROR: Indicate that FOTA process have failed or cancelled.

Returns
zero indicating OK or negative error code indicating an failure and will mark the whole FOTA process to failed. Positive return code will postpone the request, but can only be used in LWM2M_FOTA_UPDATE_IMAGE_REQ event.