Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
Configuring the Bluetooth device address in CYW20706
Bluetooth devices have a 48-bit address which is usually termed as BD_ADDR. For BR/EDR devices, there are three parts to this address: NAP, UAP and LAP whereas for BLE devices, the BD_ADDR consists of two parts: Company-ID and Company Assigned part. For more information regarding BD_ADDR and their formats, kindly refer to the BLE SIG specification.
On CYW20706, a single BD_ADDR is defined which is common for both BLE and BR/EDR applications. The BD_ADDR can be configured in the following ways:
Using the APIwiced_bt_set_local_bdaddr(wiced_bt_device_address_t bda, wiced_bt_ble_address_type_t addr_type)
This API needs to be called after the stack is initialized, i.e. after the BTM_ENABLED_EVT.
This API takes 2 parameters: the 6-byte device address and the address type.
This is useful when you want to change the BD_ADDR during runtime.
Using theBT_DEVICE_ADDRESSmake option during build
In the make target, you can include this optional parameter to set the BD_ADDR to the desired value.
For example, demo.hello_sensor-CYW920706WCDEVAL download BT_DEVICE_ADDRESS=AABBCCDDEEFF.
The BT_DEVICE_ADDRESS can also be set to random to make use of a random address.
Using the Factory_Commit_BD_ADDR VSC (Vendor Specific Command) to store the device address in flash.
There are 2 steps to this procedure:
First, set the device address to all 0xFFs by making use of the BT_DEVICE_ADDRESS=FFFFFFFFFFFF in the make target and download your application.
Then, send the Factory_Commit_BD_ADDR vendor specific HCI command. This needs to be done only for the first time after the device is programmed.
The Factory_Commit_BD_ADDR VSC has the below format:
Parameters Length: 7 bytes
Parameters: 6 byte address followed by 0x00
Example: 01 10 FC 07 AA BB CC DD EE FF 00
You can either send this HCI command over HCI UART or use wiced_bt_dev_vendor_specific_command WICED API in your application.
Note that if you are sending the HCI command over HCI UART, you will have to send a HCI reset command (01 03 0C 00) before sending the VSC.
If the device address is configured using these steps, then this address can be overwritten only by reprogramming the device, not otherwise. However, thewiced_bt_set_local_bdaddr()API can still be used to change the address to be used but this API does not overwrite the address stored in flash.
This method is most suitable for setting unique address for every device during production.