AWS IoT Over-the-air Update v3.2.0
Client library for AWS IoT OTA
Callback Types

Callback function pointer types of the OTA library. More...

Typedefs

typedef void(* OtaAppCallback_t) (OtaJobEvent_t eEvent, const void *pData)
 OTA update complete callback function typedef. More...
 

Detailed Description

Callback function pointer types of the OTA library.

Typedef Documentation

◆ OtaAppCallback_t

typedef void(* OtaAppCallback_t) (OtaJobEvent_t eEvent, const void *pData)

OTA update complete callback function typedef.

The user must register a callback function when initializing the OTA Agent. This callback is used to notify the main application when the OTA update job is complete. Typically, it is used to reset the device after a successful update by calling OTA_ActivateNewImage and may also be used to kick off user specified self tests during the Self Test phase.

The callback function is called with one of the following arguments:

 OtaJobEventActivate      OTA update is authenticated and ready to activate.
 OtaJobEventFail          OTA update failed. Unable to use this update.
 OtaJobEventStartTest     OTA job is now ready for optional user self tests.

When OtaJobEventActivate is received, the job status details have been updated with the state as ready for Self Test. After reboot, the new firmware will (normally) be notified that it is in the Self Test phase via the callback and the application may then optionally run its own tests before committing the new image.

If the callback function is called with a result of OtaJobEventFail, the OTA update job has failed in some way and should be rejected.

Parameters
[in]eEventAn OTA update event from the OtaJobEvent_t enum.
[in]pDataOptional data related to the event.