I am using the nrf connect SDK.
I want to switch multiple BDADDRs in one AdvertiseSet.
BDADDR does not change even if bt_le_adv_param.id is changed in bt_le_ext_adv_update_param().
Is there any way?
I am using the nrf connect SDK.
I want to switch multiple BDADDRs in one AdvertiseSet.
BDADDR does not change even if bt_le_adv_param.id is changed in bt_le_ext_adv_update_param().
Is there any way?
Can you elaborate what you are trying to do here? If you enable private resolveable address you can configure how frequently the address is updated by this kconfig option (you may need to update to ncs v2.2 for this to work):
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_BT_RPA_TIMEOUT
Kenneth
The purpose is to send multiple types of advertising.
I can achieve this by using multiple AdvertiseSets, but I would like to avoid this as it requires additional memory.
Also, I implemented the processing for multiple types of advertising for the nRF5 SDK, so I would like to use that processing.
The purpose is to send multiple types of advertising.
I can achieve this by using multiple AdvertiseSets, but I would like to avoid this as it requires additional memory.
Also, I implemented the processing for multiple types of advertising for the nRF5 SDK, so I would like to use that processing.
How did you do this in nRF5 SDK? I would think the address could not be changed on the fly there either?
But to answer your question, the address can be changed using the bt_id_get() and bt_id_create() api:
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/connectivity/bluetooth/api/gap.html#c.bt_id_create
Example usage:
https://github.com/nrfconnect/sdk-zephyr/blob/v2.6.99-ncs1-snapshot1/samples/bluetooth/peripheral_identity/src/peripheral_identity.c#L44
https://devzone.nordicsemi.com/f/nordic-q-a/79563/is-there-a-way-to-update-the-mac-address-after-enabling-bluetooth/329797
Kenneth
On nRF5 SDK,
call sd_ble_gap_addr_set() before sd_ble_gap_adv_start().
Example is not ExtendedAdvertising.
In AdvertiseExtension,
I'm thinking of using bt_le_ext_adv_update_param() and changing the id to change the BDADDR.
Am I wrong?
Please let me know if there is another way.
Changing bt_le_adv_param.options seems possible.
I was able to switch BDADDR between RandomStaticAddr and NonResolvablePrivateAddress by adding or removing BT_LE_ADV_OPT_USE_IDENTITY in bt_le_adv_param.options.
I would assume you need to do this similiar to the nRF5 SDK; set address before advertisement start. I do not expect changing the address on the fly while advertising will work, but I suggest you simply try it, if it works then it works, if it doesn't then it doesn't.
Kenneth
Inside the bt_le_ext_adv_cb.sent() callback function, we are calling bt_le_ext_adv_update_param().
Is this a problem?
If you are doing something wrong when calling bluetooth api's you will get an error message. As long as there is no error message you are fine.
Kenneth