Over-The-Air Device Firmware Upgrade (Alpha)#
Wi-SUN Over-The-Air Device Firmware Upgrade (OTA DFU) service is implemented for updating Wi-SUN device's firmware. The component uses the Gecko Bootloader API to perform firmware write, verify, and set to bootload operations.
A Trivial File Transfer Protocol (TFTP) client provides downloader solution to obtain a new Gecko Bootloader File (GBL) file from remote host Over-The-Air, using the Wi-SUN network. The connection to the TFTP remote host can be configured in component configuration file. The entire firmware upgrade session can be managed over CoAP. The service includes notification and status request capabilities.
Modules#
Functions#
Initialize the device firmware upgrade service.
Start firmware update.
Stop firmware update.
Reboot device.
Get the status value.
Get the status string in JSON format.
Free the status string buffer.
Get the status flag value.
OTA DFU error handler (weak implementation)
Function Documentation#
sl_wisun_ota_dfu_init#
void sl_wisun_ota_dfu_init (void )
Initialize the device firmware upgrade service.
N/A |
Initialize Wi-SUN OTA Device Firmware Upgrade service.
144
of file /mnt/raid/workspaces/ws.Mae4JfP9d/overlay/gsdk/app/wisun/component/ota_dfu/sl_wisun_ota_dfu.h
sl_wisun_ota_dfu_start_fw_update#
sl_status_t sl_wisun_ota_dfu_start_fw_update (void )
Start firmware update.
N/A |
Start firmware update by setting SL_WISUN_OTA_DFU_STATUS_FW_UPDATE_STARTED flag Returns
sl_status_t SL_STATUS_OK on success, otherwise SL_STATUS_FAIL
152
of file /mnt/raid/workspaces/ws.Mae4JfP9d/overlay/gsdk/app/wisun/component/ota_dfu/sl_wisun_ota_dfu.h
sl_wisun_ota_dfu_stop_fw_update#
sl_status_t sl_wisun_ota_dfu_stop_fw_update (void )
Stop firmware update.
N/A |
Stop firmware update by setting SL_WISUN_OTA_DFU_STATUS_FW_UPDATE_STOPPED flag Returns
sl_status_t SL_STATUS_OK on success, otherwise SL_STATUS_FAIL
160
of file /mnt/raid/workspaces/ws.Mae4JfP9d/overlay/gsdk/app/wisun/component/ota_dfu/sl_wisun_ota_dfu.h
sl_wisun_ota_dfu_reboot_and_install#
sl_status_t sl_wisun_ota_dfu_reboot_and_install (void )
Reboot device.
N/A |
Reboot device with calling corresponding gecko bootloader 'bootloader_rebootAndInstall' API This functions is available if auto-reboot mode is disabled. Returns
sl_status_t SL_STATUS_OK on success, otherwise SL_STATUS_FAIL
170
of file /mnt/raid/workspaces/ws.Mae4JfP9d/overlay/gsdk/app/wisun/component/ota_dfu/sl_wisun_ota_dfu.h
sl_wisun_ota_dfu_get_fw_update_status#
uint32_t sl_wisun_ota_dfu_get_fw_update_status (void )
Get the status value.
N/A |
Returning the value of event flags Returns
uint32_t Status
178
of file /mnt/raid/workspaces/ws.Mae4JfP9d/overlay/gsdk/app/wisun/component/ota_dfu/sl_wisun_ota_dfu.h
sl_wisun_ota_dfu_get_fw_update_status_json_str#
const char * sl_wisun_ota_dfu_get_fw_update_status_json_str (void )
Get the status string in JSON format.
N/A |
String buffer is allocated in heap by CoAP allocator Returns
const char * Allocated string pointer on success, otherwise NULL
185
of file /mnt/raid/workspaces/ws.Mae4JfP9d/overlay/gsdk/app/wisun/component/ota_dfu/sl_wisun_ota_dfu.h
sl_wisun_ota_dfu_free_fw_update_status_json_str#
void sl_wisun_ota_dfu_free_fw_update_status_json_str (const char * str)
Free the status string buffer.
[in] | str | String ptr |
Call CoAP free to release allocated memory
192
of file /mnt/raid/workspaces/ws.Mae4JfP9d/overlay/gsdk/app/wisun/component/ota_dfu/sl_wisun_ota_dfu.h
sl_wisun_ota_dfu_get_fw_update_status_flag#
bool sl_wisun_ota_dfu_get_fw_update_status_flag (const sl_wisun_ota_dfu_status_t status_flag)
Get the status flag value.
[in] | status_flag | Status flag enum |
Bool representation of status variable bit value Returns
bool true if the flag is set, otherwise false
200
of file /mnt/raid/workspaces/ws.Mae4JfP9d/overlay/gsdk/app/wisun/component/ota_dfu/sl_wisun_ota_dfu.h
sl_wisun_ota_dfu_error_hnd#
void sl_wisun_ota_dfu_error_hnd (const sl_wisun_ota_dfu_error_code_t error_code, sl_wisun_ota_dfu_error_ctx_t *const ctx)
OTA DFU error handler (weak implementation)
[in] | error_code | Error code |
[in] | ctx | Error context with error details |
Catch error in different stages of boot load.
208
of file /mnt/raid/workspaces/ws.Mae4JfP9d/overlay/gsdk/app/wisun/component/ota_dfu/sl_wisun_ota_dfu.h