Hello,
I am using WiRa SDK 10.440.8.6 with a Dialog 14695 Dev Kit.
I would like to change the Bluetooth address randomly after each connection.
I am generating a new Mac Id randomly and setting it using ble_gap_address_set (). But, I dont see any change to the Bluetooth Mac address when I discover using a Bluetooth App like LightBlue.
Let me know the correct method to change the Bluetooth Mac address.
thanks
jackyjoy
Device:
Hi jackyjoy123,
By default, the device starts advertising with a static public BD Address. The default value is declared in sdk/ble/config/ble_config.h file. If another BD address is required, then the defaultBLE_STATIC_ADDRESS macro definition should be defined in config/custom_config_xxx.h file.
For example :
#define defaultBLE_STATIC_ADDRESS {0x01, 0x02, 0x03, 0x04, 0x05, 0x06}
To set a the BD address :
/*Initialize the BLE structure related to the BD address */
static const own_address_t user_bd_address = {
.addr_type = PRIVATE_RANDOM_NONRESOLVABLE_ADDRESS,
.addr = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06}
};
/ *设置蓝牙地址* /
ble_gap_address_set(&user_bd_address, 0x00FF);
Please also see theDA1469x Tutorial Advertising Conceptstutorial.
You could also use a random resolvable or a random non-resolvable address by using the ble_gap_address_set(). The renew duration can be se in defaultBLE_ADDRESS_RENEW_DURATION macro.
Thanks, PM_Dialog