Bluetooth Mesh Firmware Distribution Client Model#
Bluetooth Mesh Firmware Distribution Client Model.
The Bluetooth Mesh Firmware Distribution Client Model is used to transfer new firmware images to Bluetooth Mesh Firmware Distribution Server Model and monitor progress of a firmware update. As a transport layer Bluetooth Mesh BLOB Transfer (MBT) models are in use.
Modules#
sl_btmesh_evt_fw_dist_client_receivers_status
sl_btmesh_evt_fw_dist_client_receivers_list
sl_btmesh_evt_fw_dist_client_receivers_list_end
sl_btmesh_evt_fw_dist_client_capabilities_status
sl_btmesh_evt_fw_dist_client_distribution_status
sl_btmesh_evt_fw_dist_client_upload_status
sl_btmesh_evt_fw_dist_client_fw_status
sl_btmesh_evt_fw_dist_client_upload_complete
sl_btmesh_evt_fw_dist_client_upload_failed
Enumerations#
The Upload Phase of the Firmware Distribution Server.
The Upload Type of an ongoing or finished upload.
Distribution Server OOB Support capability values.
The Distribution Phase of the Firmware Distribution Server.
Functions#
Macros#
Enumeration Documentation#
sl_btmesh_fw_dist_client_upload_phase_t#
sl_btmesh_fw_dist_client_upload_phase_t
The Upload Phase of the Firmware Distribution Server.
Enumerator | |
---|---|
sl_btmesh_fw_dist_client_upload_phase_idle | (0x0) No Upload in progress. |
sl_btmesh_fw_dist_client_upload_phase_transfer_in_progress | (0x1) Upload in progress. |
sl_btmesh_fw_dist_client_upload_phase_transfer_error | (0x2) Upload or Upload OOB encountered a transfer error. |
sl_btmesh_fw_dist_client_upload_phase_transfer_completed | (0x3) Upload or Upload OOB completed successfully. |
18179
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_dist_upload_type_t#
sl_btmesh_fw_dist_client_dist_upload_type_t
The Upload Type of an ongoing or finished upload.
Enumerator | |
---|---|
sl_btmesh_fw_dist_client_dist_upload_type_in_band | (0x0) In-band upload via BLOB Transfer. |
sl_btmesh_fw_dist_client_dist_upload_type_out_of_band | (0x1) Out-of-band upload. |
18211
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_dist_oob_t#
sl_btmesh_fw_dist_client_dist_oob_t
Distribution Server OOB Support capability values.
Enumerator | |
---|---|
sl_btmesh_fw_dist_client_dist_oob_not_supported | (0x0) Upload OOB not supported. |
sl_btmesh_fw_dist_client_dist_oob_supported | (0x1) Upload OOB supported. |
18226
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_dist_phase_t#
sl_btmesh_fw_dist_client_dist_phase_t
The Distribution Phase of the Firmware Distribution Server.
Enumerator | |
---|---|
sl_btmesh_fw_dist_client_dist_phase_idle | (0x0) No firmware distribution is in progress. |
sl_btmesh_fw_dist_client_dist_phase_active | (0x1) Firmware distribution in progress; sending Update Start or BLOB Transfer messages. |
sl_btmesh_fw_dist_client_dist_phase_transferred | (0x2) Firmware distribution in progress; BLOB Transfer is complete, waiting for verification. If the Update Policy is Verify Only, the Distribution Server will park here until it receives a Distribution Apply message from the Distribution Client. |
sl_btmesh_fw_dist_client_dist_phase_applying | (0x3) Firmware distribution in progress; sending Update Apply messages. |
sl_btmesh_fw_dist_client_dist_phase_completed | (0x4) Firmware distribution completed successfully for at least one Target Node. |
sl_btmesh_fw_dist_client_dist_phase_failed | (0x5) Firmware distribution failed for all Target Nodes. |
sl_btmesh_fw_dist_client_dist_phase_cancelling | (0x6) Cancelling firmware distribution. |
sl_btmesh_fw_dist_client_dist_phase_suspended | (0x7) Firmware distribution is temporarily suspended. |
18237
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
Function Documentation#
sl_btmesh_fw_dist_client_init#
sl_status_t sl_btmesh_fw_dist_client_init (uint16_t elem_index)
[in] | elem_index | Client model element index |
Initialize the Firmware Distribution Client model. An MBT Client on the same element must have been initialized prior to making this call.
Returns
SL_STATUS_OK if successful. Error code otherwise.
18592
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_deinit#
sl_status_t sl_btmesh_fw_dist_client_deinit (uint16_t elem_index)
[in] | elem_index | Client model element index |
Deinitialize the Firmware Distribution Client model. The corresponding MBT Client instance can be deinitialized before or after the Distribution Client.
Returns
SL_STATUS_OK if successful. Error code otherwise.
18604
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_setup#
sl_status_t sl_btmesh_fw_dist_client_setup (uint16_t elem_index, uint16_t appkey_index, uint8_t ttl)
[in] | elem_index | Client model element index |
[in] | appkey_index | Application key index |
[in] | ttl | The time-to-live value to use. Valid values: 0, range:[2-127] and 255. |
Set up the communication parameters for a Distribution Client instance.
Returns
SL_STATUS_OK if successful. Error code otherwise.
18618
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_setup_upload#
sl_status_t sl_btmesh_fw_dist_client_setup_upload (uint16_t elem_index, uint16_t server_address, uint8_t ttl, uint16_t timeout_base, sl_bt_uuid_64_t blob_id, uint32_t size, size_t fwid_len, const uint8_t * fwid)
[in] | elem_index | Client model element index |
[in] | server_address | Address of the target Distributor |
[in] | ttl | The time-to-live value to use for the upload. Valid values: 0, range:[2-127] and 255. |
[in] | timeout_base | Timeout Base value for the BLOB Transfer |
[in] | blob_id | BLOB ID to use |
[in] | size | Size of the firmware image |
[in] | fwid_len | Length of data in |
[in] | fwid | Firmware ID of the firmware image |
Set up an in-band Upload of a firmware image. Note that only one upload can be executed at a time. This command must be used before setting the upload image metadata via sl_btmesh_fw_dist_client_set_upload_metadata.
Returns
SL_STATUS_OK if successful. Error code otherwise.
18641
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_set_upload_metadata#
sl_status_t sl_btmesh_fw_dist_client_set_upload_metadata (uint16_t elem_index, size_t metadata_len, const uint8_t * metadata)
[in] | elem_index | Client model element index |
[in] | metadata_len | Length of data in |
[in] | metadata | Metadata for the firmware image |
Set the metadata for an in-band Upload of a firmware image.
Returns
SL_STATUS_OK if successful. Error code otherwise.
18661
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_get_receivers#
sl_status_t sl_btmesh_fw_dist_client_get_receivers (uint16_t elem_index, uint16_t dst, uint16_t start_index, uint16_t max_entries)
[in] | elem_index | Client model element index |
[in] | dst | Address of the Distributor |
[in] | start_index | Starting index of node statuses to request |
[in] | max_entries | Maximum number of node statuses to request |
Send a Receivers Get message. This function is used to get a slice of the Receivers List on the Distribution Server. The response is a Receivers List message.
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
18683
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_get#
sl_status_t sl_btmesh_fw_dist_client_get (uint16_t elem_index, uint16_t dst)
[in] | elem_index | Client model element index |
[in] | dst | Address of the Distributor |
Send a Distribution Get message. This function is used to determine the parameters of an ongoing distribution, if any. The response is a Distribution Status message.
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
18703
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_start_distribution#
sl_status_t sl_btmesh_fw_dist_client_start_distribution (uint16_t elem_index, uint16_t dst, uint8_t dist_appkey_index, uint8_t dist_ttl, uint16_t dist_timeout_base, uint8_t transfer_mode, uint8_t update_policy, uint16_t fw_list_index, uint16_t group_address, uuid_128 virtual_address)
[in] | elem_index | Client model element index |
[in] | dst | Address of the Distributor |
[in] | dist_appkey_index | Application key to use for the communication between the Distributor and Target Nodes |
[in] | dist_ttl | The time-to-live value for the Distributor to use when communicating with the Target Nodes. Valid values: 0, range:[2-127] and 255 |
[in] | dist_timeout_base | The Timeout Base value to use in the firmware image BLOB Transfer |
[in] | transfer_mode | 1 = use Push Mode, 2 = use Pull Mode (typically for LPNs) |
[in] | update_policy | Enum sl_btmesh_fw_dist_server_dfu_policy_t. 0 = Verify Only (Initiator sends Distribution Apply to Distributor to apply the update), 1 = Verify and Apply (Distributor applies update automatically) |
[in] | fw_list_index | Index of the firmware image in the Distributor's Firmware List |
[in] | group_address | Group address to use. Zero to only use unicast. |
[in] | virtual_address | If the group address is a VA hash, this needs to contain the full virtual address label UUID. Otherwise, the value of this field will be ignored. |
Send a Distribution Start message. This function is used to start a new distribution process. The Receivers List must have been populated via sl_btmesh_fw_dist_client_add_receivers, and the firmware image must have been uploaded to the Distribution Server. The response is a Distribution Status message.
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
18739
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_cancel_distribution#
sl_status_t sl_btmesh_fw_dist_client_cancel_distribution (uint16_t elem_index, uint16_t dst)
[in] | elem_index | Client model element index |
[in] | dst | Address of the Distributor |
Send a Distribution Cancel message. This function is used to cancel a distribution process. The response is a Distribution Status message.
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
18764
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_apply_distribution#
sl_status_t sl_btmesh_fw_dist_client_apply_distribution (uint16_t elem_index, uint16_t dst)
[in] | elem_index | Client model element index |
[in] | dst | Address of the Distributor |
Send a Distribution Apply message. This function is used to trigger applying the firmware update on the Target Nodes. This should only be used if the Update Policy of the distribution is Verify Only. The response is a Distribution Status message.
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
18783
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_suspend_distribution#
sl_status_t sl_btmesh_fw_dist_client_suspend_distribution (uint16_t elem_index, uint16_t dst)
[in] | elem_index | Client model element index |
[in] | dst | Address of the Distributor |
Send a Distribution Suspend message. This function is used to suspend a distribution when the BLOB Transfer is still in progress. It cannot be used after the image has already been fully transferred. The response is a Distribution Status message.
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
18802
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_add_receivers#
sl_status_t sl_btmesh_fw_dist_client_add_receivers (uint16_t elem_index, uint16_t dst, size_t nodes_len, const uint8_t * nodes)
[in] | elem_index | Client model element index |
[in] | dst | Address of the Distributor |
[in] | nodes_len | Length of data in |
[in] | nodes | List of (address [uint16], fw_index [uint8]) pairs. |
Send a Receivers Add message. This function is used to add Target Nodes to the Distribution Server's Receivers List. The response is a Receivers Status message.
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
18822
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_delete_all_receivers#
sl_status_t sl_btmesh_fw_dist_client_delete_all_receivers (uint16_t elem_index, uint16_t dst)
[in] | elem_index | Client model element index |
[in] | dst | Address of the Distributor |
Send a Receivers Delete All message. This function is used to clear the Receivers List on the Distribution Server. The response is a Receivers Status message.
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
18842
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_get_capabilities#
sl_status_t sl_btmesh_fw_dist_client_get_capabilities (uint16_t elem_index, uint16_t dst)
[in] | elem_index | Client model element index |
[in] | dst | Address of the Distributor |
Send a Capabilities Get message. This function is used to determine the Distribution Capabilities of a Distribution Server. The response is a Capabilities Status message.
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
18860
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_get_upload#
sl_status_t sl_btmesh_fw_dist_client_get_upload (uint16_t elem_index, uint16_t dst)
[in] | elem_index | Client model element index |
[in] | dst | Address of the Distributor |
Send an Upload Get message. This function is used to check if an upload is ongoing, and what its progress is. The response is an Upload Status message.
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
18877
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_start_upload#
sl_status_t sl_btmesh_fw_dist_client_start_upload (uint16_t elem_index)
[in] | elem_index | Client model element index |
Start an upload previously set up with sl_btmesh_fw_dist_client_setup_upload. Calling this function will send an Upload Start message. The response is an Upload Status message. Note that if the remote end does not respond, this function may need to be retried. Note that upon sending the Upload Start message a response timer is started for a time frame of: (10000 * (timeout_base + 2)) + (100 * ttl) in units of ms.
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
18898
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_cancel_upload#
sl_status_t sl_btmesh_fw_dist_client_cancel_upload (uint16_t elem_index, uint16_t dst)
[in] | elem_index | Client model element index |
[in] | dst | Address of the Distributor |
Cancel an upload previously started with sl_btmesh_fw_dist_client_start_upload.
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
18914
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_get_fw#
sl_status_t sl_btmesh_fw_dist_client_get_fw (uint16_t elem_index, uint16_t dst, size_t fwid_len, const uint8_t * fwid)
[in] | elem_index | Client model element index |
[in] | dst | Address of the Distributor |
[in] | fwid_len | Length of data in |
[in] | fwid | Firmware ID of the firmware image |
Send a Firmware Get message. This function is used to check if a firmware image with the given FWID exists on the Distribution Server, and if it does, to retrieve its Firmware List Index. The response is a Firmware Status message.
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
18935
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_get_fw_by_index#
sl_status_t sl_btmesh_fw_dist_client_get_fw_by_index (uint16_t elem_index, uint16_t dst, uint16_t index)
[in] | elem_index | Client model element index |
[in] | dst | Address of the Distributor |
[in] | index | Index to check |
Send a Firmware Get By Index message. This function is used to check if a firmware with a particular index exists on the Distribution Server, and if it does, to retrieve its FWID. The response is a Firmware Status message.
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
18956
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_delete_fw#
sl_status_t sl_btmesh_fw_dist_client_delete_fw (uint16_t elem_index, uint16_t dst, size_t fwid_len, const uint8_t * fwid)
[in] | elem_index | Client model element index |
[in] | dst | Address of the Distributor |
[in] | fwid_len | Length of data in |
[in] | fwid | Firmware ID of the firmware image |
Send a Firmware Delete message. This function is used to delete a particular firmware on the Distribution Server. The response is a Firmware Status message.
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
18977
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_delete_all_fw#
sl_status_t sl_btmesh_fw_dist_client_delete_all_fw (uint16_t elem_index, uint16_t dst)
[in] | elem_index | Client model element index |
[in] | dst | Address of the Distributor |
Send a Firmware Delete All message. This function is used to delete all firmware images on the Distribution Server. The response is a Firmware Status message.
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
18997
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_prepare_oob_upload#
sl_status_t sl_btmesh_fw_dist_client_prepare_oob_upload (uint16_t elem_index, size_t fwid_len, const uint8_t * fwid)
[in] | elem_index | Client model element index |
[in] | fwid_len | Length of data in |
[in] | fwid | FWID used to form the query string for the Distribution Server's Check Firmware OOB and Store Firmware OOB procedures. |
Prepare an OOB Upload. This must be called before calling the sl_btmesh_fw_dist_client_start_oob_upload command. Calling this multiple times will overwrite the state of the previous OOB Upload.
Returns
SL_STATUS_OK if successful. Error code otherwise.
19014
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_start_oob_upload#
sl_status_t sl_btmesh_fw_dist_client_start_oob_upload (uint16_t elem_index, uint16_t dst, uint16_t appkey_index, uint8_t ttl, size_t uri_len, const uint8_t * uri)
[in] | elem_index | Client model element index |
[in] | dst | Destination address |
[in] | appkey_index | Application key index to use for encrypting the message. |
[in] | ttl | The time-to-live value to use. Valid values: 0, range:[2-127] and 255. |
[in] | uri_len | Length of data in |
[in] | uri | URI used to form the query string for the Distribution Server's Check Firmware OOB and Store Firmware OOB procedures. |
Start an OOB Upload. The response is an sl_btmesh_evt_fw_dist_client_upload_status event. This command must be repeated by the application if the remote end does not respond. If the event's status field is zero, the request was accepted; otherwise it was rejected. If the event indicates that the request was accepted, the type field will be set to 1 to denote an out-of-band upload.
sl_btmesh_fw_dist_client_prepare_oob_upload must have been called prior to using this command.
To poll the status of the OOB Upload, the application can either repeat this command, or use the command sl_btmesh_fw_dist_client_get_upload.
When a sl_btmesh_evt_fw_dist_client_upload_status event with type set to 1 and progress set to 100 is received, the application can consider the upload complete.
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
19053
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_suspend_upload#
sl_status_t sl_btmesh_fw_dist_client_suspend_upload (uint16_t elem_index)
[in] | elem_index | Client model element index |
Suspend an Upload's BLOB Transfer. An Upload that isn't yet in the BLOB Transfer phase, or which has failed, cannot be suspended. The suspension is entirely local; there is no message sent over the air. The remote receiver's BLOB Transfer Server will go to the suspended phase when the Upload Timeout timer expires. When the Upload is resumed, it will continue from where it previously left off.
Returns
SL_STATUS_OK if successful. Error code otherwise.
19074
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h
sl_btmesh_fw_dist_client_resume_upload#
sl_status_t sl_btmesh_fw_dist_client_resume_upload (uint16_t elem_index)
[in] | elem_index | Client model element index |
Resume a suspended upload. The command sl_btmesh_fw_dist_client_start_upload must be used after this command, and it may need to be repeated if the remote end does not respond. When the Upload is resumed, the BLOB Transfer will continue from where it previously left off.
Returns
SL_STATUS_OK if successful. Error code otherwise.
19089
of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h