Modules#

Type definitions

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.

Functions#

void

Initialize the device firmware upgrade service.

sl_status_t

Start firmware update.

sl_status_t

Stop firmware update.

uint32_t

Get the status value.

const char *

Get the status string in JSON format.

void

Free the status string buffer.

bool
sl_wisun_ota_dfu_get_fw_update_status_flag(const sl_wisun_ota_dfu_status_t status_flag)

Get the status flag value.

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)

Function Documentation#

sl_wisun_ota_dfu_init#

void sl_wisun_ota_dfu_init (void )

Initialize the device firmware upgrade service.

Parameters
N/A

Initialize Wi-SUN OTA Device Firmware Upgrade service.


Definition at line 145 of file /mnt/raid/workspaces/ws.SZ9MaSA5u/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.

Parameters
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


Definition at line 153 of file /mnt/raid/workspaces/ws.SZ9MaSA5u/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.

Parameters
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


Definition at line 161 of file /mnt/raid/workspaces/ws.SZ9MaSA5u/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.

Parameters
N/A

Returning the value of event flags Returns

  • uint32_t Status


Definition at line 168 of file /mnt/raid/workspaces/ws.SZ9MaSA5u/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.

Parameters
N/A

String buffer is allocated in heap by CoAP allocator Returns

  • const char * Allocated string pointer on success, otherwise NULL


Definition at line 175 of file /mnt/raid/workspaces/ws.SZ9MaSA5u/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.

Parameters
[in]str

String ptr

Call CoAP free to release allocated memory


Definition at line 182 of file /mnt/raid/workspaces/ws.SZ9MaSA5u/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.

Parameters
[in]status_flag

Status flag enum

Bool representation of status variable bit value Returns

  • bool true if the flag is set, otherwise false


Definition at line 190 of file /mnt/raid/workspaces/ws.SZ9MaSA5u/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)

Parameters
[in]error_code

Error code

[in]ctx

Error context with error details

Catch error in different stages of boot load.


Definition at line 198 of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/app/wisun/component/ota_dfu/sl_wisun_ota_dfu.h