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

Setting resolvable private address

I want to set the resolvable private address ( RPA ) manually instead of letting softdevice do it. I went through documentation but I am not sure about it. I know that I can configure IRK and refresh interval in softdevice but I want to do it with my code to analyze the performance or to use own encryption method.

I am using this to set the RPA :

ble_gap_addr_t new_add ;
new_add.addr_type=BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE;
for(uint32_t j = 0; j < BLE_GAP_ADDR_LEN; j++){  
	new_add.addr[j] = rpa[j];
}
err_code = sd_ble_gap_address_set(BLE_GAP_ADDR_CYCLE_MODE_NONE, &new_add);
APP_ERROR_CHECK(err_code);

where "rpa" is generated by me using my own IRK.

But as mentioned in the sd_ble_gap_address_set() documentation :

If the address cycle mode is BLE_GAP_ADDR_CYCLE_MODE_NONE and the application is using privacy, the application must take care to generate and set new private addresses periodically to comply with the Privacy specification in Bluetooth Core Spec.

So, my doubts are :

  1. I am able to set the RPA by using the above code and see it on the scanner but Is it the correct and valid way ? Are there any other options (eg. privacy) that needs to be set ? (Valid in the sense that other devices should be able to resolve it if they have correct IRK).

  2. What is the minimum interval to refresh the RPA ?

Thanks in advance

Related