This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

RESOLVABLE PRIVATE RANDOM ADDRESS and BLE_GAP_EVT_ADV_SET_TERMINATED

Hi,

I'm trying to setup my nRF52832 to advertise using a RESOLVABLE RANDOM PRIVATE address and to obtain this I have used the sd_ble_gap_privacy_set() before starting advertising in this way:

le_gap_privacy_params_t privacy_params = {
	.privacy_mode = BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY,
	.private_addr_type = BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE,
	.private_addr_cycle_s = BLE_GAP_MAX_PRIVATE_ADDR_CYCLE_INTERVAL_S,
	.p_device_irk = m_irk
};
APP_ERROR_CHECK(sd_ble_gap_privacy_set(&privacy_params));

where m_irk is my IRK key.

The code works, and I can see my device (using nRF Connect app for Android) that changes its address, but the problem is that the address is changed too frequently.

In the advertising parameters I have an advertising duration of 30 seconds and when I get the  BLE_GAP_EVT_ADV_SET_TERMINATED I update some data inside the advertising packet and restart advertising. The thing that I notice is that, when I restart advertising the MAC address is changed even if in the privacy_params is configured to change after 900s. If I try to start advertising for the first time using a timeout of 0 (so that it never timeout and I never get the BLE_GAP_EVT_ADV_SET_TERMINATED event), the MAC address is changed according to the time specified in the privacy_params

Is this an expected behaviour? Are there any workarounds to get the device address changed according to the privacy_params, even if the advertising is restarted due to a BLE_GAP_EVT_ADV_SET_TERMINATED event?

Parents Reply Children
No Data
Related