Go to the source code of this file.
|
| enum | golioth_fw_state { GOLIOTH_FW_STATE_IDLE = 0
, GOLIOTH_FW_STATE_DOWNLOADING = 1
, GOLIOTH_FW_STATE_DOWNLOADED = 2
, GOLIOTH_FW_STATE_UPDATING = 3
} |
| | State of downloading or updating the firmware. More...
|
| |
| enum | golioth_dfu_result {
GOLIOTH_DFU_RESULT_INITIAL = 0
, GOLIOTH_DFU_RESULT_FIRMWARE_UPDATED_SUCCESSFULLY
, GOLIOTH_DFU_RESULT_NOT_ENOUGH_FLASH_MEMORY
, GOLIOTH_DFU_RESULT_OUT_OF_RAM
,
GOLIOTH_DFU_RESULT_CONNECTION_LOST
, GOLIOTH_DFU_RESULT_INTEGRITY_CHECK_FAILURE
, GOLIOTH_DFU_RESULT_UNSUPPORTED_PACKAGE_TYPE
, GOLIOTH_DFU_RESULT_INVALID_URI
,
GOLIOTH_DFU_RESULT_FIRMWARE_UPDATE_FAILED
, GOLIOTH_DFU_RESULT_UNSUPPORTED_PROTOCOL
} |
| | Result of downloading or updating the firmware. More...
|
| |
|
| 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. More...
|
| |
| int | golioth_fw_observe_desired (struct golioth_client *client, struct coap_reply *reply, coap_reply_t desired_cb) |
| | Observe desired firmware. More...
|
| |
| int | golioth_fw_download (struct golioth_client *client, struct golioth_fw_download_ctx *ctx, const char *uri, size_t uri_len, struct coap_reply *reply, golioth_blockwise_download_received_t received_cb) |
| | Request firmware download from Golioth. More...
|
| |
| 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. More...
|
| |
◆ golioth_dfu_result
Result of downloading or updating the firmware.
| Enumerator |
|---|
| GOLIOTH_DFU_RESULT_INITIAL | |
| GOLIOTH_DFU_RESULT_FIRMWARE_UPDATED_SUCCESSFULLY | |
| GOLIOTH_DFU_RESULT_NOT_ENOUGH_FLASH_MEMORY | |
| GOLIOTH_DFU_RESULT_OUT_OF_RAM | |
| GOLIOTH_DFU_RESULT_CONNECTION_LOST | |
| GOLIOTH_DFU_RESULT_INTEGRITY_CHECK_FAILURE | |
| GOLIOTH_DFU_RESULT_UNSUPPORTED_PACKAGE_TYPE | |
| GOLIOTH_DFU_RESULT_INVALID_URI | |
| GOLIOTH_DFU_RESULT_FIRMWARE_UPDATE_FAILED | |
| GOLIOTH_DFU_RESULT_UNSUPPORTED_PROTOCOL | |
◆ golioth_fw_state
State of downloading or updating the firmware.
| Enumerator |
|---|
| GOLIOTH_FW_STATE_IDLE | |
| GOLIOTH_FW_STATE_DOWNLOADING | |
| GOLIOTH_FW_STATE_DOWNLOADED | |
| GOLIOTH_FW_STATE_UPDATING | |
◆ golioth_fw_desired_parse()
| 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.
- Parameters
-
| payload | Pointer to CBOR encoded 'desired' description |
| payload_len | Length of CBOR encoded 'desired' description |
| version | Pointer to version string, which will be updated by this function |
| version_len | On input pointer to available space in version string, on output actual length of version string |
| uri | URI of the image, which will be updated by this function |
| uri_len | On input pointer to available space in URI string, on output actual length of URI string |
- Return values
-
◆ golioth_fw_download()
Request firmware download from Golioth.
- Parameters
-
| client | Client instance |
| ctx | Firmware download context |
| uri | Pointer to URI string |
| uri_len | Length of URI string |
| reply | CoAP reply handler object used for notifying about received firmware blocks |
| received_cb | Callback that will be executed with each incoming block of firmware |
- Return values
-
◆ golioth_fw_observe_desired()
| int golioth_fw_observe_desired |
( |
struct golioth_client * |
client, |
|
|
struct coap_reply * |
reply, |
|
|
coap_reply_t |
desired_cb |
|
) |
| |
Observe desired firmware.
- Parameters
-
| client | Client instance |
| reply | CoAP reply handler object used for notifying about received desired firmware description |
| desired_cb | Callback that will be executed when desired firmware description is received |
- Return values
-
◆ golioth_fw_report_state()
Report state of firmware.
- Parameters
-
| client | Client instance |
| package_name | Package name of firmware |
| current_version | Current firmware version |
| target_version | Target firmware version |
| state | State of firmware |
| result | Result of downloading or updating firmware |
- Return values
-