Btmesh_firmware_update_server_api#

BT Mesh Firmware Update Server user-overridable API

Enumerations#

enum
BTMESH_FW_UPDATE_SERVER_VERIFY_PENDING
BTMESH_FW_UPDATE_SERVER_VERIFY_ERROR
BTMESH_FW_UPDATE_SERVER_VERIFY_SUCCESS
}

Verification step results.

enum
BTMESH_FW_UPDATE_SERVER_METADATA_CHECK_PENDING
BTMESH_FW_UPDATE_SERVER_METADATA_CHECK_ERROR
BTMESH_FW_UPDATE_SERVER_METADATA_CHECK_SUCCESS
}

Metadata check step result.

enum
BTMESH_FW_UPDATE_SERVER_ADDITIONAL_INFORMATION_NO_CHANGE = 0x0
BTMESH_FW_UPDATE_SERVER_ADDITIONAL_INFORMATION_COMP_DATA_CHANGE_NO_REMOTE_PROV = 0x1
BTMESH_FW_UPDATE_SERVER_ADDITIONAL_INFORMATION_COMP_DATA_CHANGE_REMOTE_PROV = 0x2
BTMESH_FW_UPDATE_SERVER_ADDITIONAL_INFORMATION_UNPROVISION = 0x3
BTMESH_FW_UPDATE_SERVER_ADDITIONAL_INFORMATION_RESERVED_START = 0x4
}

Definitions taken from BT Mesh Specification v1.1.

Functions#

sl_btmesh_fw_update_server_verify_start(sl_bt_uuid_64_t const *const blob_id, uint8_t **const verify_chunk_buffer, uint32_t *const verify_chunk_size, const uint32_t blob_size)
void
sl_btmesh_fw_update_server_verify_progress_ui_update(sl_btmesh_fw_update_server_verify_state_t status, uint32_t progress, uint32_t size)
sl_btmesh_fw_update_server_metadata_check_start(void const *metadata, const uint8_t len, sl_btmesh_fw_update_server_additional_information_t *const additional_information)
sl_btmesh_firmware_update_server_metadata_check_step(sl_btmesh_fw_update_server_additional_information_t *additional_information)
void
sl_btmesh_fw_update_server_update_start(sl_bt_uuid_64_t const *const blob_id)
sl_status_t
mesh_platform_get_installed_firmware_information(uint8_t index, uint8_t *fwid_len, const uint8_t **fwid_ptr, uint8_t *uri_len, const uint8_t **uri_ptr)

Enumeration Documentation#

sl_btmesh_fw_update_server_verify_state_e#

sl_btmesh_fw_update_server_verify_state_e

Verification step results.

Enumerator
BTMESH_FW_UPDATE_SERVER_VERIFY_PENDING

Verification pending.

BTMESH_FW_UPDATE_SERVER_VERIFY_ERROR

Verification error.

BTMESH_FW_UPDATE_SERVER_VERIFY_SUCCESS

Verification successful.


sl_btmesh_fw_update_server_metadata_check_state_e#

sl_btmesh_fw_update_server_metadata_check_state_e

Metadata check step result.

Enumerator
BTMESH_FW_UPDATE_SERVER_METADATA_CHECK_PENDING

Metadata check pending.

BTMESH_FW_UPDATE_SERVER_METADATA_CHECK_ERROR

Metadata check error.

BTMESH_FW_UPDATE_SERVER_METADATA_CHECK_SUCCESS

Metadata check successful.


sl_btmesh_fw_update_server_additional_information_e#

sl_btmesh_fw_update_server_additional_information_e

Definitions taken from BT Mesh Specification v1.1.

Enumerator
BTMESH_FW_UPDATE_SERVER_ADDITIONAL_INFORMATION_NO_CHANGE

No changes to node composition data.

BTMESH_FW_UPDATE_SERVER_ADDITIONAL_INFORMATION_COMP_DATA_CHANGE_NO_REMOTE_PROV

Node composition data changed. The node does not support remote provisioning.

BTMESH_FW_UPDATE_SERVER_ADDITIONAL_INFORMATION_COMP_DATA_CHANGE_REMOTE_PROV

Node composition data changed, and remote provisioning is supported. The node supports remote provisioning and composition data page 0x80. Page 0x80 contains different composition data than page 0x0.

BTMESH_FW_UPDATE_SERVER_ADDITIONAL_INFORMATION_UNPROVISION

Node unprovisioned. The node is unprovisioned after successful application of a verified firmware image.

BTMESH_FW_UPDATE_SERVER_ADDITIONAL_INFORMATION_RESERVED_START

Start of reserved values.


Typedef Documentation#

sl_btmesh_fw_update_server_verify_state_t#

typedef enum sl_btmesh_fw_update_server_verify_state_e sl_btmesh_fw_update_server_verify_state_t

Verification step results.


sl_btmesh_fw_update_server_metadata_check_state_t#

typedef enum sl_btmesh_fw_update_server_metadata_check_state_e sl_btmesh_fw_update_server_metadata_check_state_t

Metadata check step result.


sl_btmesh_fw_update_server_additional_information_t#

typedef enum sl_btmesh_fw_update_server_additional_information_e sl_btmesh_fw_update_server_additional_information_t

Definitions taken from BT Mesh Specification v1.1.


Function Documentation#

sl_btmesh_fw_update_server_verify_start#

sl_btmesh_fw_update_server_verify_state_t sl_btmesh_fw_update_server_verify_start (sl_bt_uuid_64_t const *const blob_id, uint8_t **const verify_chunk_buffer, uint32_t *const verify_chunk_size, const uint32_t blob_size)
Parameters
TypeDirectionArgument NameDescription
sl_bt_uuid_64_t const *const[in]blob_id

Identifier of the BLOB to be verified

uint8_t **const[out]verify_chunk_buffer

Verification buffer. User needs to pass the verification buffer to the framework. User also needs to free memory if it was allocated on heap, which could be done in sl_btmesh_fw_update_server_apply. If it's set to NULL, then no data is read from storage automatically during verification.

uint32_t *const[out]verify_chunk_size

Size of verification chunk. Progress calculation is based on this value.

const uint32_t[in]blob_size

Size of the BLOB to be verified

User callback for determining the maximum chunk size of verification

Used to determine how big chunks can be for sl_btmesh_fw_update_server_verify_step

Returns

  • Current state of verification

Return values

  • BTMESH_FW_UPDATE_SERVER_VERIFY_PENDING: If further processing required

  • BTMESH_FW_UPDATE_SERVER_VERIFY_ERROR: In case of an error

  • BTMESH_FW_UPDATE_SERVER_VERIFY_SUCCESS: In case verification is done and successful


sl_btmesh_fw_update_server_verify_step#

sl_btmesh_fw_update_server_verify_state_t sl_btmesh_fw_update_server_verify_step (void const * data, const uint32_t len)
Parameters
TypeDirectionArgument NameDescription
void const *[in]data

Buffered data

const uint32_t[in]len

Length of the buffer

User callback to execute one step of the verification

Receives a chunk of data equal to or less in size defined with sl_btmesh_fw_update_server_verify_start

Returns

  • Current state of verification

Return values

  • BTMESH_FW_UPDATE_SERVER_VERIFY_PENDING: If further processing required

  • BTMESH_FW_UPDATE_SERVER_VERIFY_ERROR: In case of an error

  • BTMESH_FW_UPDATE_SERVER_VERIFY_SUCCESS: In case verification is done and successful


sl_btmesh_fw_update_server_verify_progress_ui_update#

void sl_btmesh_fw_update_server_verify_progress_ui_update (sl_btmesh_fw_update_server_verify_state_t status, uint32_t progress, uint32_t size)
Parameters
TypeDirectionArgument NameDescription
sl_btmesh_fw_update_server_verify_state_t[in]status

Verification status

uint32_t[in]progress

Number of verified bytes

uint32_t[in]size

Total number of bytes which shall be verified

User callback to update the user interface with verification progress

If FW_UPDATE_SERVER_VERIFY_PROGRESS_UI_UPDATE_PERIOD is not zero then it specifies the period of this function call in order to limit the user interface update rate. If the macro is zero then this function is called whenever verification is active and progress is made.


sl_btmesh_fw_update_server_metadata_check_start#

sl_btmesh_fw_update_server_metadata_check_state_t sl_btmesh_fw_update_server_metadata_check_start (void const * metadata, const uint8_t len, sl_btmesh_fw_update_server_additional_information_t *const additional_information)
Parameters
TypeDirectionArgument NameDescription
void const *[in]metadata

Buffered metadata

const uint8_t[in]len

Metadata length

sl_btmesh_fw_update_server_additional_information_t *const[out]additional_information

Used in BT Mesh response to metadata check

User callback indicating start of metadata check

Returns

  • Current state of metadata check

Return values

  • BTMESH_FW_UPDATE_SERVER_METADATA_CHECK_PENDING: If further processing required

  • BTMESH_FW_UPDATE_SERVER_METADATA_CHECK_ERROR: In case of an error

  • BTMESH_FW_UPDATE_SERVER_METADATA_CHECK_SUCCESS: In case metadata check is done and successful


sl_btmesh_firmware_update_server_metadata_check_step#

sl_btmesh_fw_update_server_metadata_check_state_t sl_btmesh_firmware_update_server_metadata_check_step (sl_btmesh_fw_update_server_additional_information_t * additional_information)
Parameters
TypeDirectionArgument NameDescription
sl_btmesh_fw_update_server_additional_information_t *[out]additional_information

Used in BT Mesh response to metadata check

User callback executing one step of metadata check

Returns

  • Current state of metadata check

Return values

  • BTMESH_FW_UPDATE_SERVER_METADATA_CHECK_PENDING: If further processing required

  • BTMESH_FW_UPDATE_SERVER_METADATA_CHECK_ERROR: In case of an error

  • BTMESH_FW_UPDATE_SERVER_METADATA_CHECK_SUCCESS: In case metadata check is done and successful


sl_btmesh_fw_update_server_update_start#

void sl_btmesh_fw_update_server_update_start (sl_bt_uuid_64_t const *const blob_id)
Parameters
TypeDirectionArgument NameDescription
sl_bt_uuid_64_t const *const[in]blob_id

Identifier of the BLOB containing firmware

User callback indicating update start

Called after metadata check is done.

Can be redefined to accommodate user application functionality.


sl_btmesh_fw_update_server_update_canceled#

void sl_btmesh_fw_update_server_update_canceled (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

User callback indicating update cancellation

Can be redefined to accommodate user application functionality.


sl_btmesh_fw_update_server_update_aborted#

void sl_btmesh_fw_update_server_update_aborted (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

User callback indicating update abort

Can be redefined to accommodate user application functionality.


sl_btmesh_fw_update_server_apply#

void sl_btmesh_fw_update_server_apply (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

User callback indicating firmware apply request

Can be redefined to accommodate user application functionality.


mesh_platform_get_installed_firmware_information#

sl_status_t mesh_platform_get_installed_firmware_information (uint8_t index, uint8_t * fwid_len, const uint8_t ** fwid_ptr, uint8_t * uri_len, const uint8_t ** uri_ptr)
Parameters
TypeDirectionArgument NameDescription
uint8_t[in]index

DFU Storage index

uint8_t *[out]fwid_len

Length of the firmware ID

const uint8_t **[out]fwid_ptr

Pointer to the firmware ID

uint8_t *[out]uri_len

Length of the Uniform Resource Identifier (URI)

const uint8_t **[out]uri_ptr

Pointer to the Uniform Resource Identifier (URI)

Used to retrieve information about firmware stored on the device for DFU Returns

  • SL_STATUS_OK if successful, SL_STATUS_BT_MESH_DOES_NOT_EXIST if the index is invalid