Function anjay_fw_update_install

Function Documentation

int anjay_fw_update_install(anjay_t *anjay, const anjay_fw_update_handlers_t *handlers, void *user_arg, const anjay_fw_update_initial_state_t *initial_state)

Installs the Firmware Update object in an Anjay object.

The Firmware Update module does not require explicit cleanup; all resources will be automatically freed up during the call to anjay_delete.

Parameters:
  • anjay – Anjay object for which the Firmware Update Object is installed.

  • handlers – Pointer to a set of handler functions that handle the platform-specific part of firmware update process. Note: Contents of the structure are NOT copied, so it needs to remain valid for the lifetime of the object.

  • user_arg – Opaque user pointer that will be passed as the first argument to handler functions.

  • initial_state – Information about the state to initialize the Firmware Update object in. It is intended to be used after either an orderly reboot caused by a firmware update attempt to report the update result, or by an unexpected reboot in the middle of the download process. If the object shall be initialized in a neutral initial state, NULL might be passed.

Returns:

0 on success, or a negative value in case of error.