anjay
Loading...
Searching...
No Matches
anjay_fw_update_initial_state_t Struct Reference

#include <fw_update.h>

Data Fields

anjay_fw_update_initial_result_t result
 
const char * persisted_uri
 
size_t resume_offset
 
const struct anjay_etagresume_etag
 
bool prefer_same_socket_downloads
 
bool use_lwm2m_send
 

Detailed Description

Information about the state to initialize the Firmware Update object in.

Field Documentation

◆ persisted_uri

const char* persisted_uri

Value to initialize the Package URI resource with. The passed string is copied, so the pointer is allowed to become invalid after return from anjay_fw_update_install .

Required when result == ANJAY_FW_UPDATE_INITIAL_DOWNLOADING; if it is not provided (NULL) in such case, anjay_fw_update_reset_t handler will be called from anjay_fw_update_install to reset the Firmware Update object into the Idle state.

Optional when result == ANJAY_FW_UPDATE_INITIAL_DOWNLOADED; in this case it signals that the firmware was downloaded using the Pull mechanism.

In all other cases it is ignored.

◆ prefer_same_socket_downloads

bool prefer_same_socket_downloads

Informs the module to try reusing sockets of existing LwM2M Servers to download the firmware image if the download URI matches any of the LwM2M Servers.

◆ result

Controls initialization of the State and Update Result resources. It is intended to be used after a reboot caused by a firmware update attempt, to report the update result.

◆ resume_etag

const struct anjay_etag* resume_etag

ETag of the download process to resume. The passed value is copied, so the pointer is allowed to become invalid after return from anjay_fw_update_install .

Required when result == ANJAY_FW_UPDATE_INITIAL_DOWNLOADING and resume_offset > 0; if it is not provided (NULL) in such case, anjay_fw_update_reset_t handler will be called from anjay_fw_update_install to reset the Firmware Update object into the Idle state.

◆ resume_offset

size_t resume_offset

Number of bytes that has been already successfully downloaded and are available at the time of calling anjay_fw_update_install .

It is ignored unless result == ANJAY_FW_UPDATE_INITIAL_DOWNLOADING, in which case the following call to anjay_fw_update_stream_write_t shall append the passed chunk of data at the offset set here. If resumption from the set offset is impossible, the library will call anjay_fw_update_reset_t and anjay_fw_update_stream_open_t to restart the download process.

◆ use_lwm2m_send

bool use_lwm2m_send

Enables using LwM2M Send to report State, Update Result and Firmware Version to the LwM2M Server (if LwM2M Send is enabled) during firmware update.


The documentation for this struct was generated from the following file: