Because a firmware download and the reboot that follows must not be interrupted by the application, the module tracks the download separately from the cloud state:
FOTA_STARTINGmoves the state machine toSTATE_FOTAfrom anywhere underSTATE_RUNNING, which stops the periodic synchronization.- The cloud state at that point is remembered in
cloud_history. ACLOUD_DISCONNECTEDorCLOUD_CONNECTEDmessage received during the download updatescloud_historywithout leavingSTATE_FOTA. FOTA_ABORTEDrestores the remembered cloud state, so the application resumes synchronizing if the connection is still up.FOTA_REBOOT_REQUESTmoves the state machine toSTATE_REBOOTING, which reboots the device to let MCUboot swap in the new image.