### MBT Client Setup Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-mbt-client Sets up a new BLOB transfer. This is the first step in starting a transfer. Basic information of the BLOB and the transfer are defined with this command. After setting up a transfer, the information of the servers should be queried with sl_btmesh_mbt_client_query_information. ```APIDOC ## sl_btmesh_mbt_client_setup ### Description Sets up a new BLOB transfer. This is the first step in starting a transfer. Basic information of the BLOB and the transfer are defined with this command. After setting up a transfer, the information of the servers should be queried with sl_btmesh_mbt_client_query_information. ### Method `[Not specified in text, likely an internal function call or part of a larger structure]` ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **servers_len** (size_t) - Input - Length of data in `servers`. - **servers** (const uint8_t *) - Input - List of MBT Server addresses, represented as little endian two byte sequences. ### Request Example `[Not applicable for this function]` ### Response #### Success Response (SL_STATUS_OK) - Success indication if the setup is successful. #### Response Example `[Not applicable for this function]` ``` -------------------------------- ### Set Up New BLOB Transfer - sl_btmesh_mbt_client_setup Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-mbt-client Initializes a new BLOB transfer by defining basic transfer information and server list. This is the first step in starting a transfer. After setup, server information must be queried using sl_btmesh_mbt_client_query_information before initiating the actual transfer. ```C sl_status_t sl_btmesh_mbt_client_setup( uint16_t elem_index, uint32_t appkey_index, uint16_t blob_id, uint32_t blob_size, size_t servers_len, const uint8_t *servers ) ``` -------------------------------- ### Setup Firmware Distribution Parameters Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-fw-standalone-updater Configures the firmware image details for distribution including size, BLOB ID, and firmware ID. This must be called after initialization and before starting the distribution process. ```c sl_status_t sl_btmesh_fw_standalone_updater_setup( uint16_t elem_index, uint32_t fw_size, sl_bt_uuid_64_t blob_id, size_t fwid_len, const uint8_t *fwid ); ``` -------------------------------- ### Respond to Distribution Start Request - C Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-fw-dist-server Implements the sl_btmesh_fw_dist_server_dist_start_rsp function to acknowledge or reject a distribution start request. It requires the element index and a status code (success or internal error). This response dictates whether the client can proceed with distribution, upload, or get firmware commands. ```c sl_status_t sl_btmesh_fw_dist_server_dist_start_rsp (uint16_t elem_index, uint16_t status) ``` -------------------------------- ### Installing CPC Daemon and Library Source: https://github.com/SiliconLabs/cpc-daemon These commands are used to install the compiled CPC daemon, its associated library, and configuration files onto the system. 'sudo make install' copies the necessary files to their designated locations, and 'sudo ldconfig' updates the dynamic linker cache, making the library available for use by applications. ```bash sudo make install sudo ldconfig ``` -------------------------------- ### Start Firmware Image Distribution (C) Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-fw-standalone-updater Initiates the firmware image distribution process. It requires prior setup of distribution parameters and receivers. This function configures distribution settings like application key index, TTL, timeout, transfer mode, group address, and virtual address. ```c sl_status_t sl_btmesh_fw_standalone_updater_start( uint16_t elem_index, uint16_t dist_appkey_index, uint8_t dist_ttl, uint16_t dist_timeout_base, uint8_t transfer_mode, uint16_t group_address, uuid_128 virtual_address ); ``` -------------------------------- ### NVM3 Initialization and Counter Operations Example Source: https://docs.silabs.com/gecko-platform/latest/platform-driver/nvm3 Demonstrates how to initialize the NVM3 driver, write a counter value, increment it, and then read the updated value. This example utilizes NVM3 HAL flash handle for initialization and basic NVM3 functions. ```c void nvm3_example_2(void) { // Declare a nvm3_Init_t struct of name nvm3Data2 with initialization data. // This is passed to nvm3_open() below. NVM3_DEFINE_SECTION_INIT_DATA(nvm3Data2, &nvm3_halFlashHandle); nvm3_Handle_t handle; sl_status_t status; uint32_t counter = 1; // Initialize the handle to zero (void)memset(&handle, 0, sizeof(nvm3_Handle_t)); status = nvm3_open(&handle, &nvm3Data2); if (status != SL_STATUS_OK) { // Handle error } // Erase all objects nvm3_eraseAll(&handle); // Write first counter value with key 1 nvm3_writeCounter(&handle, USER_KEY, counter); // Increment the counter by 1 without reading out the updated value nvm3_incrementCounter(&handle, USER_KEY, NULL); // Read the counter value nvm3_readCounter(&handle, USER_KEY, &counter); } ``` -------------------------------- ### Scene Setup Server Command and Response IDs in C Source: https://docs.silabs.com/btmesh/9.0.0/bluetooth-mesh-api/sl-btmesh-scene-setup-server Macro definitions for Scene Setup Server command and response identifiers used in the BGAPI protocol for scene initialization and deinitialization operations. ```c #define sl_btmesh_cmd_scene_setup_server_init_id 0x00510028 #define sl_btmesh_cmd_scene_setup_server_deinit_id 0x01510028 #define sl_btmesh_rsp_scene_setup_server_init_id 0x00510028 #define sl_btmesh_rsp_scene_setup_server_deinit_id 0x01510028 ``` -------------------------------- ### Initialize Scene Setup Server Model in C Source: https://docs.silabs.com/btmesh/9.0.0/bluetooth-mesh-api/sl-btmesh-scene-setup-server Initializes the Scene Setup Server model for a specified element index. This function activates the model in the mesh stack without requiring internal configurations. Returns SL_STATUS_OK on success or an error code on failure. ```c sl_status_t sl_btmesh_scene_setup_server_init(uint16_t elem_index); // Parameters: // uint16_t elem_index - [in] Index of the element // Returns: // SL_STATUS_OK if successful // Error code otherwise ``` -------------------------------- ### MBT Client Initialization and Setup Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-mbt-client Initializes the MBT client and sets up transfer parameters. ```APIDOC ## MBT Client Initialization ### Description Initializes the MBT client module. This function must be called before any other MBT client functions. ### Method `sl_status_t sl_btmesh_mbt_client_init(uint16_t elem_index, uint16_t max_servers, uint16_t max_blocks, uint16_t max_chunks_per_block)` ### Parameters - **elem_index** (uint16_t) - Required - The element index of the MBT client. - **max_servers** (uint16_t) - Required - The maximum number of servers the client can manage. - **max_blocks** (uint16_t) - Required - The maximum number of blocks allowed per transfer. - **max_chunks_per_block** (uint16_t) - Required - The maximum number of chunks allowed per block. ## MBT Client Setup ### Description Sets up the parameters for a new MBT transfer. This includes blob information, security settings, and network targeting. ### Method `sl_status_t sl_btmesh_mbt_client_setup(uint16_t elem_index, sl_bt_uuid_64_t blob_id, uint32_t blob_size, uint16_t appkey_index, uint8_t ttl, uint16_t timeout_base, uint8_t supported_transfer_modes, uint16_t group_address, uuid_128 virtual_address, uint16_t multicast_threshold, size_t servers_len, const uint8_t *servers)` ### Parameters - **elem_index** (uint16_t) - Required - The element index of the MBT client. - **blob_id** (sl_bt_uuid_64_t) - Required - The unique identifier for the blob being transferred. - **blob_size** (uint32_t) - Required - The total size of the blob in bytes. - **appkey_index** (uint16_t) - Required - The index of the application key to use for encryption. - **ttl** (uint8_t) - Required - The Time To Live for the mesh messages. - **timeout_base** (uint16_t) - Required - The base timeout value for transfer steps. - **supported_transfer_modes** (uint8_t) - Required - Bitmask indicating supported transfer modes (PUSH, PULL, BOTH). - **group_address** (uint16_t) - Optional - The group address to use for multicast transfers. - **virtual_address** (uuid_128) - Optional - The virtual address to use for unicast transfers. - **multicast_threshold** (uint16_t) - Optional - The threshold for switching to multicast. - **servers_len** (size_t) - Required - The number of servers in the `servers` array. - **servers** (const uint8_t *) - Required - An array of server addresses to include in the transfer. ``` -------------------------------- ### ZAP Installation for Windows Source: https://docs.silabs.com/btmesh/latest/btmesh/9.0.2/bluetooth-application-security-design-considerations Provides instructions for installing the ZAP tool on Windows. It highlights a potential issue with the canvas module and suggests rebuilding it. This is relevant for developers using Silicon Labs' Bluetooth SDK. ```text Zap Installation Windows | ZAP Getting Started | Silicon Labs ZAP | v1.0.0 | Silicon Labs https://docs.silabs.com/.../zap-installation-wind... Software Documentation//Silicon Labs ZAP//Version 1.0.0 ... /canvas.node' or \zap\node_modules\canvas\build\Release\canvas.node is not a valid Win32 application., rebuild canvas as follows: ``` -------------------------------- ### Example Header File for Bluetooth Mesh LLMs Source: https://armmbed.github.io/mbed-crypto/html/about.html This snippet shows an example header file structure for the Bluetooth Mesh LLMs library. It defines essential structures and function prototypes required for interacting with the library's functionalities. This file serves as a primary interface for developers integrating the library into their projects. ```c #ifndef SILABS_BT_MESH_LLMS_H #define SILABS_BT_MESH_LLMS_H // Include necessary system headers or other library headers #include // Define common types and constants typedef uint8_t mesh_address_t; // Function prototypes void silabs_bt_mesh_llms_init(void); int silabs_bt_mesh_llms_send_message(mesh_address_t destination, const uint8_t *payload, uint16_t length); #endif // SILABS_BT_MESH_LLMS_H ``` -------------------------------- ### MBT Server Transfer Start Response Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-mbt-server Sends a response to a client's request to start a BLOB transfer. ```APIDOC ## sl_btmesh_mbt_server_transfer_start_rsp ### Description Sends a response to the client indicating the outcome of a BLOB transfer start request. This function should be called after processing the client's request to start a transfer. ### Method `sl_status_t sl_btmesh_mbt_server_transfer_start_rsp( uint16_t elem_index, uint8_t status ); ### Parameters #### Path Parameters - `elem_index` (uint16_t) - Required - The element index for the MBT Server. - `status` (uint8_t) - Required - The status code indicating the result of the transfer start request (e.g., `sl_btmesh_mbt_server_status_success`). ### Return Value - `sl_status_t` - Returns `SL_STATUS_OK` on success, or an error code otherwise. ### Example ```c sl_status_t result = sl_btmesh_mbt_server_transfer_start_rsp(0, 0x00); // 0x00 for success if (result == SL_STATUS_OK) { // Response sent successfully } ``` ``` -------------------------------- ### Enable MBT Block Start Request Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-mbt-server Enables the server to accept block start requests from the client. ```APIDOC ## sl_btmesh_mbt_server_enable_block_start_req ### Description Enables the MBT Server to accept block start requests from the client. This function is typically used to control when the server is ready to receive new blocks. ### Method `sl_status_t sl_btmesh_mbt_server_enable_block_start_req(uint16_t elem_index); ### Parameters #### Path Parameters - `elem_index` (uint16_t) - Required - The element index for the MBT Server. ### Return Value - `sl_status_t` - Returns `SL_STATUS_OK` on success, or an error code otherwise. ### Example ```c sl_status_t result = sl_btmesh_mbt_server_enable_block_start_req(0); if (result == SL_STATUS_OK) { // Block start request enabled successfully } ``` ``` -------------------------------- ### Example Macro Implementations for Bluetooth Mesh LLMs Source: https://armmbed.github.io/mbed-crypto/html/about.html This section provides example macro implementations used within the Bluetooth Mesh LLMs library. These macros often abstract complex operations or define constants for easier use. They are crucial for customizing library behavior and integrating with specific hardware or configurations. ```c #ifndef SILABS_BT_MESH_LLMS_MACROS_H #define SILABS_BT_MESH_LLMS_MACROS_H // Example macro for defining a maximum payload size #define SILABS_BT_MESH_LLMS_MAX_PAYLOAD_SIZE 255 // Example macro for checking a status code #define SILABS_BT_MESH_LLMS_IS_SUCCESS(status) ((status) == 0) #endif // SILABS_BT_MESH_LLMS_MACROS_H ``` -------------------------------- ### Send Firmware Distribution Server Upload Start Response (C) Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-fw-dist-server Sends a response to an Upload Start request from a Distribution Client. The status parameter indicates whether the server accepted the upload request, allowing the client to proceed or abort. ```c sl_status_t sl_btmesh_fw_dist_server_upload_start_rsp(uint16_t elem_index, uint8_t status); ``` -------------------------------- ### Bluetooth Mesh MBT Client Setup Function Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-mbt-client Sets up a Bluetooth Mesh BLOB Transfer (MBT) client for a transfer. It prepares the client to send BLOB data to servers. This function initiates the transfer setup process and returns status information. ```c sl_status_t sl_btmesh_mbt_client_setup ( uint16_t elem_index, uint16_t server_address, uuid_128 virtual_address, uint16_t appkey_index, uint8_t ttl, uint16_t blob_id, uint16_t total_blocks ); ``` -------------------------------- ### Start MBT Server Transfer in C Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-mbt-server Starts a new MBT Server transfer session with specified blob ID, timeout, and TTL. Initiates the server-side preparation for receiving a block transfer from a mesh client. ```c sl_status_t sl_btmesh_mbt_server_start( uint16_t elem_index, sl_bt_uuid_64_t blob_id, uint16_t timeout_10s, uint8_t ttl ) ``` -------------------------------- ### Install Node.js LTS via Chocolatey (Windows) Source: https://docs.silabs.com/btmesh/latest/btmesh/9.0.2/bt-mesh-interop-report This command installs the Long Term Support (LTS) version of Node.js using Chocolatey, a package manager for Windows. This is a prerequisite for using tools like ZAP (Zigbee Application Profile). ```bash choco install nodejs-lts ``` -------------------------------- ### MBT Server Start Transfer Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-mbt-server Initiates a large binary object transfer on the MBT Server. ```APIDOC ## sl_btmesh_mbt_server_start ### Description Starts a new large binary object (BLOB) transfer initiated by the client. This function should be called when the server receives a BLOB transfer start message. ### Method `sl_status_t sl_btmesh_mbt_server_start( uint16_t elem_index, sl_bt_uuid_64_t blob_id, uint16_t timeout_10s, uint8_t ttl ); ### Parameters #### Path Parameters - `elem_index` (uint16_t) - Required - The element index for the MBT Server. - `blob_id` (sl_bt_uuid_64_t) - Required - The unique identifier for the BLOB being transferred. - `timeout_10s` (uint16_t) - Required - Timeout value in units of 10 seconds. - `ttl` (uint8_t) - Required - Time-to-Live value for the transfer. ### Return Value - `sl_status_t` - Returns `SL_STATUS_OK` on success, or an error code otherwise. ### Example ```c sl_bt_uuid_64_t my_blob_id = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}; sl_status_t result = sl_btmesh_mbt_server_start(0, my_blob_id, 60, 7); if (result == SL_STATUS_OK) { // Transfer started successfully } ``` ``` -------------------------------- ### NVM3 Initialization and Data Object Management in C Source: https://docs.silabs.com/gecko-platform/latest/platform-driver/nvm3 Demonstrates complete NVM3 initialization with static data section definition, handle creation, data writing/reading operations, and repacking. Shows how to create NVM storage areas, manage multiple data objects with keys, and perform conditional repacking based on available space. ```C #include "nvm3.h" #include "nvm3_hal_flash.h" // Create a NVM area of 24kB (size must equal N * FLASH_PAGE_SIZE, N is integer). Create a cache of 10 entries. NVM3_DEFINE_SECTION_STATIC_DATA(nvm3Data1, 24576, 10); void nvm3_example_1(void) { // Declare a nvm3_Init_t struct of name nvm3Data1 with initialization data. NVM3_DEFINE_SECTION_INIT_DATA(nvm3Data1, &nvm3_halFlashHandle); nvm3_Handle_t handle; sl_status_t status; size_t numberOfObjects; unsigned char data1[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; unsigned char data2[] = { 11, 12, 13, 14, 15 }; uint32_t objectType; size_t dataLen1; size_t dataLen2; // Initialize the handle to zero (void)memset(&handle, 0, sizeof(nvm3_Handle_t)); status = nvm3_open(&handle, &nvm3Data1); if (status != SL_STATUS_OK) { // Handle error } // Get the number of valid keys already in NVM3 numberOfObjects = nvm3_countObjects(&handle); // Skip if we have initial keys. If not, generate objects and store persistently in NVM3 if (numberOfObjects < 2) { // Erase all objects and write initial data to NVM3 nvm3_eraseAll(&handle); nvm3_writeData(&handle, 1, data1, sizeof(data1)); nvm3_writeData(&handle, 2, data2, sizeof(data2)); } // Find size of data for object with key identifier 1 and 2 and read out nvm3_getObjectInfo(&handle, 1, &objectType, &dataLen1); if (objectType == NVM3_OBJECTTYPE_DATA) { nvm3_readData(&handle, 1, data1, dataLen1); } nvm3_getObjectInfo(&handle, 2, &objectType, &dataLen2); if (objectType == NVM3_OBJECTTYPE_DATA) { nvm3_readData(&handle, 2, data2, dataLen2); } // Update and write back data data1[0]++; data2[0]++; nvm3_writeData(&handle, 1, data1, dataLen1); nvm3_writeData(&handle, 2, data2, dataLen2); // Do repacking if needed if (nvm3_repackNeeded(&handle)) { status = nvm3_repack(&handle); if (status != SL_STATUS_OK) { // Handle error } } } ``` -------------------------------- ### Address Range Check Intrinsic Syntax Source: https://www.keil.com/support/man/docs/armclang_ref/armclang_ref_pge1446715440722.htm Defines the syntax for the `cmse_check_address_range` intrinsic, which checks permissions on a given address range. It takes a pointer to the start of the range, the size of the range, and a flags parameter. It returns a pointer to the checked range on success or NULL on failure. ```c void *cmse_check_address_range(void *ptr, size_t size, int flags) ``` -------------------------------- ### Bluetooth Mesh MBT Server: Respond to Block Start Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-mbt-server Provides a response to a block start event when `sl_btmesh_mbt_server_enable_block_start_req` has been called. This function is used to acknowledge or handle the block start request from the client. ```c sl_status_t sl_btmesh_mbt_server_block_start_rsp (uint16_t elem_index); ``` -------------------------------- ### Setup Firmware Distribution Parameters (C) Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-fw-standalone-updater Initializes the firmware distribution process by setting essential parameters such as firmware size, BLOB ID, and firmware ID. This function must be called before other setup commands like setting metadata or adding receivers. It takes the element index, firmware size, BLOB ID, firmware ID length, and the firmware ID as input. ```c sl_status_t sl_btmesh_fw_standalone_updater_setup( uint16_t elem_index, uint32_t fw_size, sl_bt_uuid_64_t blob_id, size_t fwid_len, const uint8_t *fwid ); ``` -------------------------------- ### Install mingw-w64 GCC Compiler using Pacman Source: https://www.msys2.org/ This command installs the mingw-w64 GCC compiler for the UCRT64 environment within MSYS2. It utilizes the Pacman package manager to resolve dependencies and install the necessary packages. Ensure you have MSYS2 installed and updated before running this command. ```bash pacman -S mingw-w64-ucrt-x86_64-gcc ``` -------------------------------- ### Enable MBT Server Block Start Requests in C Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-mbt-server Enables handling of block start requests from mesh clients. Allows the server to receive and process block start messages during transfer operations. ```c sl_status_t sl_btmesh_mbt_server_enable_block_start_req(uint16_t elem_index) ``` -------------------------------- ### Execute Distribution Step (C) Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-fw-standalone-updater Advances the firmware distribution process to the next step. This command is used iteratively to manage the progress of the distribution after it has been started using `sl_btmesh_fw_standalone_updater_start`. The function takes the element index as a parameter. ```c sl_status_t sl_btmesh_fw_standalone_updater_execute_distribution_step( uint16_t elem_index ); ``` -------------------------------- ### NVM3 Counter Object Initialization in C Source: https://docs.silabs.com/gecko-platform/latest/platform-driver/nvm3 Demonstrates initialization of NVM3 counter objects which provide a compact 32-bit counter storage mechanism with minimal NVM wear. Shows static data section setup and macro definitions for counter-based applications. ```C #include "nvm3.h" #include "nvm3_hal_flash.h" // Create a NVM area of 24kB (size must equal N * FLASH_PAGE_SIZE, N is integer). Create a cache of 10 entries. NVM3_DEFINE_SECTION_STATIC_DATA(nvm3Data2, 24576, 10); #define USER_KEY 1 ``` -------------------------------- ### MBT Server Block Start Response Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-mbt-server Sends a response to a client's block start request. ```APIDOC ## sl_btmesh_mbt_server_block_start_rsp ### Description Sends a response to the client indicating the outcome of a block start request. This function should be called after processing the client's request to start a new block. ### Method `sl_status_t sl_btmesh_mbt_server_block_start_rsp( uint16_t elem_index, uint8_t status ); ### Parameters #### Path Parameters - `elem_index` (uint16_t) - Required - The element index for the MBT Server. - `status` (uint8_t) - Required - The status code indicating the result of the block start request (e.g., `sl_btmesh_mbt_server_status_success`). ### Return Value - `sl_status_t` - Returns `SL_STATUS_OK` on success, or an error code otherwise. ### Example ```c sl_status_t result = sl_btmesh_mbt_server_block_start_rsp(0, 0x00); // 0x00 for success if (result == SL_STATUS_OK) { // Response sent successfully } ``` ``` -------------------------------- ### NVM3 Driver Initialization Function Source: https://docs.silabs.com/gecko-platform/latest/platform-driver/nvm3 Opens an NVM3 driver instance, initializing it with provided parameters and returning a handle to manage the NVM3 state. ```c sl_status_t nvm3_open(nvm3_Handle_t *h, const nvm3_Init_t *i) ``` -------------------------------- ### Deinitialize Scene Setup Server Model in C Source: https://docs.silabs.com/btmesh/9.0.0/bluetooth-mesh-api/sl-btmesh-scene-setup-server Deinitializes the Scene Setup Server model for a specified element index. This function deactivates the model in the mesh stack, disabling its functionality until re-initialized. ```c sl_status_t sl_btmesh_scene_setup_server_deinit(uint16_t elem_index); // Parameters: // uint16_t elem_index - [in] Index of the element // Returns: // SL_STATUS_OK if successful // Error code otherwise ``` -------------------------------- ### Running CPC Daemon with Configuration and Binding Options Source: https://github.com/SiliconLabs/cpc-daemon This demonstrates how to run the CPC daemon (cpcd) with specific command-line arguments. The '--conf' option allows specifying a custom configuration file, while '--bind' (with 'ecdh' or 'plain-text') enables security binding processes. The '--key' option can be used with binding to specify a key file. ```bash # Bind primary and secondary. The binding key will be generated where # "binding_key_file" points to in the config file $ ./cpcd -c cpcd.conf --bind ecdh # Alternatively, the key file can be specified on the command line $ ./cpcd -c cpcd.conf --bind ecdh --key binding.key ``` -------------------------------- ### Bluetooth Mesh Firmware Distribution Server Initialization (C) Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-fw-dist-server Initializes the Bluetooth Mesh Firmware Distribution Server. This function configures the server with parameters such as element index, maximum list sizes for nodes and firmware entries, maximum firmware size, total storage size, multicast threshold, and supported Out-of-Band (OOB) URI schemes. ```c sl_status_t sl_btmesh_fw_dist_server_init( uint16_t elem_index, uint16_t max_node_list_size, uint16_t max_fw_entries, uint32_t max_fw_size, uint32_t total_store_size, uint16_t multicast_threshold, size_t oob_supported_uri_scheme_names_len, const uint8_t *oob_supported_uri_scheme_names ); ``` -------------------------------- ### Response: Get Relay ID (C) Source: https://docs.silabs.com/btmesh/8.0.2/bluetooth-mesh-api/sl-btmesh-test The response structure for the get relay ID command in Bluetooth Mesh testing. It returns the current relay identifier of the node. ```c #define sl_btmesh_rsp_test_get_relay_id 0x02220028 ``` -------------------------------- ### Send MBT Server Transfer Start Response in C Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-mbt-server Sends a response to a transfer start request with a status code. Allows the server to accept or reject transfer initiation from a mesh client. ```c sl_status_t sl_btmesh_mbt_server_transfer_start_rsp( uint16_t elem_index, uint8_t status ) ``` -------------------------------- ### Send MBT Server Block Start Response in C Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-mbt-server Sends a response to a block start request with a status code. Confirms to the mesh client whether the server is ready to accept block data. ```c sl_status_t sl_btmesh_mbt_server_block_start_rsp( uint16_t elem_index, uint8_t status ) ``` -------------------------------- ### Initiate Block Start (C) Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-mbt-client Initiates the start of a new block for the MBT client. This is called after sl_btmesh_evt_mbt_client_start_transfer_complete or sl_btmesh_evt_mbt_client_query_block_status_complete. Server responses are received via sl_btmesh_evt_mbt_client_server_block_status. The sl_btmesh_evt_mbt_client_start_block_complete event indicates all server responses are received. ```c sl_status_t sl_btmesh_mbt_client_start_block(uint16_t elem_index, uint16_t chunk_size, uint16_t *block_number, uint32_t *block_size); ``` -------------------------------- ### Setup Standalone Updater Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-fw-standalone-updater Configures the Standalone Updater with essential parameters for firmware distribution. ```APIDOC ## POST /btmesh/fw_standalone_updater/setup ### Description Sets up the Standalone Updater with configuration parameters. ### Method POST ### Endpoint /btmesh/fw_standalone_updater/setup ### Parameters #### Request Body - **elem_index** (uint16_t) - Required - Element index. - **transfer_mode** (uint8_t) - Required - Transfer mode for firmware updates. - **group_address** (uint16_t) - Required - Group address for the update distribution. - **virtual_address** (uuid_128) - Required - Virtual address for the update distribution. ### Response #### Success Response (200) - **status** (sl_status_t) - SL_STATUS_OK if successful. #### Error Response - **status** (sl_status_t) - Error code if setup fails. ``` -------------------------------- ### Create Application Key for Provisioning Source: https://docs.silabs.com/btmesh/8.0.2/bluetooth-mesh-api/sl-btmesh-prov Creates a new application key on the Provisioner, bound to a specified network key. This application key can be deployed to a node using the `sl_btmesh_config_client_add_appkey` command. The function takes network key index, application key index, and the key value as input. It also handles output buffer for the generated application key. Returns `SL_STATUS_OK` on success or an error code. ```c sl_status_t sl_btmesh_prov_create_appkey (uint16_t netkey_index, uint16_t appkey_index, size_t key_len, const uint8_t * key, size_t max_application_key_size, size_t * application_key_len, uint8_t * application_key) ``` -------------------------------- ### Payload CoSWID (CBOR) Source: https://datatracker.ietf.org/doc/html/draft-ietf-rats-eat-11 This CBOR example represents a payload CoSWID created by a software vendor. It includes the software name, version, entity details (name and role), and file information. This is used within the TEE attestation example. ```cbor 1398229316({ / Unique CoSWID ID / 0: "3a24", / tag-version / 12: 1, / software-name / 1: "Acme TEE OS", / software-version / 13: "3.1.4", / entity / 2: [ { / entity-name / 31: "Acme TEE OS", / role / 33: 1 / tag-creator / }, { / entity-name / 31: "Acme TEE OS", / role / 33: 2 / software-creator / } ], / payload / 6: { / ...file / 17: { / ...fs-name / 24: "acme_tee_3.exe" } } }) ``` -------------------------------- ### MBT Server Initialization Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-mbt-server Initializes the MBT Server module with specified configuration parameters. ```APIDOC ## sl_btmesh_mbt_server_init ### Description Initializes the MBT Server module with parameters that define its operational characteristics, such as block and chunk sizes, transfer limits, and pull mode settings. ### Method `sl_status_t sl_btmesh_mbt_server_init( uint16_t elem_index, uint8_t min_block_size_log, uint8_t max_block_size_log, uint16_t max_chunks_per_block, uint16_t max_chunk_size, uint32_t max_blob_size, uint8_t supported_transfer_modes, uint16_t pull_mode_chunks_to_request, uint16_t pull_mode_retry_interval_ms, uint16_t pull_mode_retry_count ); ### Parameters #### Path Parameters - `elem_index` (uint16_t) - Required - The element index for the MBT Server. - `min_block_size_log` (uint8_t) - Required - The minimum block size in log base 2. - `max_block_size_log` (uint8_t) - Required - The maximum block size in log base 2. - `max_chunks_per_block` (uint16_t) - Required - The maximum number of chunks allowed per block. - `max_chunk_size` (uint16_t) - Required - The maximum size of a single chunk. - `max_blob_size` (uint32_t) - Required - The maximum size of a BLOB that can be transferred. - `supported_transfer_modes` (uint8_t) - Required - Bitmask indicating the supported transfer modes. - `pull_mode_chunks_to_request` (uint16_t) - Required - Number of chunks to request in pull mode. - `pull_mode_retry_interval_ms` (uint16_t) - Required - Retry interval in milliseconds for pull mode. - `pull_mode_retry_count` (uint16_t) - Required - Retry count for pull mode. ### Return Value - `sl_status_t` - Returns `SL_STATUS_OK` on success, or an error code otherwise. ### Example ```c sl_status_t result = sl_btmesh_mbt_server_init(0, 5, 10, 100, 200, 1024*1024, 0x01, 5, 1000, 3); if (result == SL_STATUS_OK) { // Initialization successful } ``` ``` -------------------------------- ### Provisioning Prepare Key Refresh (C) Source: https://docs.silabs.com/btmesh/8.0.2/bluetooth-mesh-api/sl-btmesh-test Initiates the preparation phase for key refresh during Bluetooth Mesh provisioning. This command is used in testing to manage the key refresh process. It requires relevant key refresh parameters. ```c #define sl_btmesh_cmd_test_prov_prepare_key_refresh_id 0x24220028 ``` -------------------------------- ### Bluetooth Mesh MBT Server: Enable Block Start Request Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-mbt-server Enables the Bluetooth Mesh MBT Server to treat block start events as requests rather than notifications. When enabled, `sl_btmesh_mbt_server_block_start_rsp` must be called after receiving the `sl_btmesh_evt_mbt_server_block_start` event. ```c sl_status_t sl_btmesh_mbt_server_enable_block_start_req (uint16_t elem_index); ``` -------------------------------- ### Initialize Bluetooth Mesh Provisioner Source: https://docs.silabs.com/btmesh/8.0.2/bluetooth-mesh-api/sl-btmesh-prov Initializes the Bluetooth Mesh Provisioner. This function must be called before any other Provisioner commands. It sets up the necessary structures and prepares the stack for provisioning operations. Successful initialization is confirmed by the `sl_btmesh_evt_prov_initialized` event, while failure is indicated by `sl_btmesh_evt_prov_initialization_failed`. ```c sl_status_t sl_btmesh_prov_init(); ``` -------------------------------- ### MBT Client Start Transfer Function Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-mbt-client Initiates an MBT data transfer. This function starts the process of sending or receiving data, specifying the block size and transfer mode. It's a key function for beginning any MBT data exchange. ```c sl_status_t sl_btmesh_mbt_client_start_transfer(uint16_t elem_index, uint8_t block_size_log, uint8_t transfer_mode) ``` -------------------------------- ### MBT Client Setup Function Source: https://docs.silabs.com/btmesh/9.0.1/bluetooth-mesh-api/sl-btmesh-mbt-client Sets up the MBT client for a specific transfer, including blob information, appkey, and network parameters. This function prepares the client for sending or receiving data based on the provided configuration. It allows specifying transfer modes, group addresses, and server lists. ```c sl_status_t sl_btmesh_mbt_client_setup(uint16_t elem_index, sl_bt_uuid_64_t blob_id, uint32_t blob_size, uint16_t appkey_index, uint8_t ttl, uint16_t timeout_base, uint8_t supported_transfer_modes, uint16_t group_address, uuid_128 virtual_address, uint16_t multicast_threshold, size_t servers_len, const uint8_t *servers) ```