The following states are used by the module:
-
STATE_RUNNING: Parent state entered on initialization. Its entry function initializes the FOTA poll library, confirms the running image, and publishes
FOTA_MODULE_READY. It handlesFOTA_DOWNLOAD_CANCELon behalf of all substates that do not handle it themselves, which is how the cancel transition is reached from the downloading and reboot pending states.- STATE_WAITING_FOR_POLL_REQUEST: Default substate, in which the module is idle and waits for a
FOTA_POLL_REQUEST. A cancel request is logged and ignored here, as there is nothing to cancel. - STATE_POLLING_FOR_UPDATE: The module asks nRF Cloud whether a job is available. If there is no job, it reports
FOTA_ABORTEDand returns to waiting. A cancel request is logged and ignored, since the download has not started. - STATE_DOWNLOADING_UPDATE: A download is in progress. The module publishes
FOTA_STARTINGon entry so the application knows not to interfere. - STATE_REBOOT_PENDING: The update is downloaded and the module publishes
FOTA_REBOOT_REQUEST. The state machine stays here until the application reboots the device. - STATE_CANCELING: A cancel request was received. The module calls
fota_download_cancel()and returns to waiting when the library confirms the abort.
- STATE_WAITING_FOR_POLL_REQUEST: Default substate, in which the module is idle and waits for a