Function anjay_advanced_fw_update_set_state_and_result

Function Documentation

int anjay_advanced_fw_update_set_state_and_result(anjay_t *anjay, anjay_iid_t iid, anjay_advanced_fw_update_state_t state, anjay_advanced_fw_update_result_t result)

Sets the Advanced Firmware Update object instance State to state and Result to result , interrupting the update process.

If the function fails, neither Update State nor Update Result are changed.

Some state transitions are disallowed and cause this function to fail:

WARNING: calling this in anjay_advanced_fw_update_perform_upgrade_t handler is supported, but the result of using it from within any other of anjay_advanced_fw_update_handlers_t handlers is undefined.

Parameters:
  • anjay – Anjay object to operate on.

  • iid – Instance ID of an Advanced Firmware Object.

  • state – Value of the State resource to set.

  • result – Value of the Update Result resource to set.

Returns:

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