20 #define GOLIOTH_OTA_BLOCKSIZE 1024
89 const uint8_t* payload,
105 const char* package);
151 size_t* block_nbytes,
175 const char* current_version,
176 const char* target_version,
#define CONFIG_GOLIOTH_OTA_MAX_VERSION_LEN
#define CONFIG_GOLIOTH_OTA_MAX_NUM_COMPONENTS
#define CONFIG_GOLIOTH_OTA_MAX_PACKAGE_NAME_LEN
void(* golioth_get_cb_fn)(golioth_client_t client, const golioth_response_t *response, const char *path, const uint8_t *payload, size_t payload_size, void *arg)
void * golioth_client_t
Opaque handle to the Golioth client.
const golioth_ota_component_t * golioth_ota_find_component(const golioth_ota_manifest_t *manifest, const char *package)
golioth_status_t golioth_ota_observe_manifest_async(golioth_client_t client, golioth_get_cb_fn callback, void *arg)
golioth_ota_state_t golioth_ota_get_state(void)
size_t golioth_ota_size_to_nblocks(size_t component_size)
Convert a size in bytes to the number of blocks required (of size up to GOLIOTH_OTA_BLOCKSIZE)
golioth_status_t golioth_ota_get_block_sync(golioth_client_t client, const char *package, const char *version, size_t block_index, uint8_t *buf, size_t *block_nbytes, bool *is_last, int32_t timeout_s)
golioth_status_t golioth_ota_payload_as_manifest(const uint8_t *payload, size_t payload_size, golioth_ota_manifest_t *manifest)
golioth_status_t golioth_ota_report_state_sync(golioth_client_t client, golioth_ota_state_t state, golioth_ota_reason_t reason, const char *package, const char *current_version, const char *target_version, int32_t timeout_s)
golioth_ota_reason_t
A reason associated with state changes.
golioth_ota_state_t
State of OTA update, reported to Golioth server.
@ GOLIOTH_OTA_REASON_FIRMWARE_UPDATE_FAILED
Firmware update was not successful.
@ GOLIOTH_OTA_REASON_OUT_OF_RAM
Insufficient RAM on device.
@ GOLIOTH_OTA_REASON_INVALID_URI
URI not valid.
@ GOLIOTH_OTA_REASON_CONNECTION_LOST
Lost connection to server during OTA update.
@ GOLIOTH_OTA_REASON_UNSUPPORTED_PROTOCOL
Protocol not supported.
@ GOLIOTH_OTA_REASON_NOT_ENOUGH_FLASH_MEMORY
Insufficient flash memory on device.
@ GOLIOTH_OTA_REASON_READY
OTA update is ready to go. Also used for "no reason".
@ GOLIOTH_OTA_REASON_FIRMWARE_UPDATED_SUCCESSFULLY
Firmware update was successful.
@ GOLIOTH_OTA_REASON_INTEGRITY_CHECK_FAILURE
Data integrity check of downloaded artifact failed.
@ GOLIOTH_OTA_REASON_UNSUPPORTED_PACKAGE_TYPE
Package type not supported.
@ GOLIOTH_OTA_STATE_DOWNLOADED
OTA has been downloaded and written to flash.
@ GOLIOTH_OTA_STATE_IDLE
No OTA update in progress.
@ GOLIOTH_OTA_STATE_UPDATING
OTA is being applied to the system, but is not yet complete.
@ GOLIOTH_OTA_STATE_DOWNLOADING
OTA is being downloaded and written to flash.
A component/artifact within an OTA manifest.
bool is_compressed
True, if the component is compressed and requires decompression.
int32_t size
Size of the artifact, in bytes.
An OTA manifest, composed of multiple components/artifacts.
size_t num_components
Number of artifacts.
int32_t seqnum
OTA release sequence number.