AWS IoT Over-the-air Update  v3.1.0
Client library for AWS IoT OTA
OTA_SetImageState

Set the state of the current MCU image.

The states are OtaImageStateTesting, OtaImageStateAccepted, OtaImageStateAborted or OtaImageStateRejected; see OtaImageState_t documentation. This will update the status of the current image and publish to the active job status topic.

Parameters
[in]stateThe state to set of the OTA image.
Returns
OtaErrNone if successful, otherwise an error code prefixed with 'OtaErr' from the list above.

Example Set image state to reflect new image is accepted in application callback.

static void otaAppCallback( OtaJobEvent_t event,
const void * pData )
{
OtaErr_t otaErr = OtaErrNone;
if( event == OtaJobEventStartTest )
{
if( err != OtaErrNone )
{
// Handle failure or retry setting the image state.
}
}
// Handle other events
}
OtaImageState_t
OtaImageState_t
OTA Image states.
Definition: ota_private.h:314
OtaJobEventStartTest
@ OtaJobEventStartTest
OTA job is now in self test, perform user tests.
Definition: ota.h:168
OTA_SetImageState
OtaErr_t OTA_SetImageState(OtaImageState_t state)
Set the state of the current MCU image.
Definition: ota.c:3300
OtaJobEvent_t
OtaJobEvent_t
OTA Job callback events.
Definition: ota.h:165
OtaErr_t
OtaErr_t
The OTA API return status. OTA agent error codes are in the upper 8 bits of the 32 bit OTA error word...
Definition: ota.h:79
OtaImageStateAccepted
@ OtaImageStateAccepted
The state of the OTA MCU Image post successful download and successful self_test.
Definition: ota_private.h:317
OtaErrNone
@ OtaErrNone
No error occurred during the operation.
Definition: ota.h:80