7 #ifndef GOLIOTH_INCLUDE_NET_GOLIOTH_FW_H_
8 #define GOLIOTH_INCLUDE_NET_GOLIOTH_FW_H_
59 uint8_t *version,
size_t *version_len,
60 uint8_t *uri,
size_t *uri_len);
88 const uint8_t *uri,
size_t uri_len,
111 const char *package_name,
112 const char *current_version,
113 const char *target_version,
133 const char *package_name,
134 const char *current_version,
135 const char *target_version,
int golioth_fw_report_state(struct golioth_client *client, const char *package_name, const char *current_version, const char *target_version, enum golioth_fw_state state, enum golioth_dfu_result result)
Report state of firmware.
int golioth_fw_report_state_cb(struct golioth_client *client, const char *package_name, const char *current_version, const char *target_version, enum golioth_fw_state state, enum golioth_dfu_result result, golioth_req_cb_t cb, void *user_data)
Report state of firmware (callback based)
int golioth_fw_desired_parse(const uint8_t *payload, uint16_t payload_len, uint8_t *version, size_t *version_len, uint8_t *uri, size_t *uri_len)
Parse desired firmware description.
golioth_fw_state
State of downloading or updating the firmware.
@ GOLIOTH_FW_STATE_DOWNLOADED
@ GOLIOTH_FW_STATE_UPDATING
@ GOLIOTH_FW_STATE_DOWNLOADING
golioth_dfu_result
Result of downloading or updating the firmware.
@ GOLIOTH_DFU_RESULT_INITIAL
@ GOLIOTH_DFU_RESULT_CONNECTION_LOST
@ GOLIOTH_DFU_RESULT_FIRMWARE_UPDATE_FAILED
@ GOLIOTH_DFU_RESULT_NOT_ENOUGH_FLASH_MEMORY
@ GOLIOTH_DFU_RESULT_UNSUPPORTED_PROTOCOL
@ GOLIOTH_DFU_RESULT_UNSUPPORTED_PACKAGE_TYPE
@ GOLIOTH_DFU_RESULT_FIRMWARE_UPDATED_SUCCESSFULLY
@ GOLIOTH_DFU_RESULT_INTEGRITY_CHECK_FAILURE
@ GOLIOTH_DFU_RESULT_OUT_OF_RAM
@ GOLIOTH_DFU_RESULT_INVALID_URI
int golioth_fw_observe_desired(struct golioth_client *client, golioth_req_cb_t cb, void *user_data)
Observe desired firmware.
int golioth_fw_download(struct golioth_client *client, const uint8_t *uri, size_t uri_len, golioth_req_cb_t cb, void *user_data)
Request firmware download from Golioth.
int(* golioth_req_cb_t)(struct golioth_req_rsp *rsp)
User callback for handling valid response from server or error condition.
Represents a Golioth client instance.