Integrating firmware update platform hooks with your application
The FOTA library offers platform hook callbacks that you can use to integrate platform-specific code during the FOTA flow; for example, if Device Management Client shares a resource with another component of the system.
By default, FOTA provides an empty implementation for these hooks. You can override these hooks by injecting the
FOTA_CUSTOM_PLATFORM macro to the build and implementing all of the callback functions listed in fota_platform_hooks.h:
fota_platform_init_hook()- Platform init hook, which the client calls when it initializes the FOTA module.
The client uses
fota_platform_init_hook()to register custom components, as described in the Implementing component update, and subcomponents for a combined update, as described in the Implementing combined update.
fota_platform_start_update_hook()- Platform start update hook, which the client calls when the update begins.
fota_platform_finish_update_hook()- Platform finish update hook, which the client calls when the update has finished.
fota_platform_abort_update_hook()- Platform start update hook, which the client calls if an update is aborted.