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... | |
typedef OtaJobParseErr_t(* | OtaCustomJobCallback_t) (const char *pcJSON, uint32_t ulMsgLen) |
Custom Job callback function typedef. More... | |
Callback function pointer types of the OTA library.
typedef void(* OtaAppCallback_t) (OtaJobEvent_t eEvent, const void *pData) |
OTA update complete callback function typedef.
The user may 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. If the user does not supply a custom callback function, a default callback handler is used that automatically calls OTA_ActivateNewImage after a successful update.
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.
[in] | eEvent | An OTA update event from the OtaJobEvent_t enum. |
[in] | pData | Optional data related to the event. |
typedef OtaJobParseErr_t(* OtaCustomJobCallback_t) (const char *pcJSON, uint32_t ulMsgLen) |
Custom Job callback function typedef.
The user may register a callback function when initializing the OTA Agent. This callback will be called when the OTA agent cannot parse a job document.
[in] | pcJSON | Pointer to the json document received by the OTA agent. |
[in] | ulMsgLen | Length of the json document received by the agent. |