Function anjay_fw_update_set_result

Function Documentation

int anjay_fw_update_set_result(anjay_t *anjay, anjay_fw_update_result_t result)

Sets the Firmware Update Result to result, interrupting the update process.

A successful call to this function always sets Update State to Idle (0). 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_fw_update_perform_upgrade_t handler is supported, but the result of using it from within any other of anjay_fw_update_handlers_t handlers is undefined.

Parameters:
  • anjay – Anjay object to operate on.

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

Returns:

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