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

how to set ble gap address type to RANDOM_PRIVATE_RESOLVABLE

I want to change the ble gap address type to RANDOM_PRIVATE_RESOLVABLE. In gap_params_init(), I add these line at the end of the function

ble_gap_addr_t *p_gap_address;
err_code = sd_ble_gap_addr_get(p_gap_address);
APP_ERROR_CHECK(err_code);
p_gap_address->addr_type = BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE;
err_code = sd_ble_gap_addr_set(p_gap_address);
APP_ERROR_CHECK(err_code);

The code is based on ble_app_template. No error or warning, but it does not work. what should I do?

Parents Reply
  • Hi, I stumbled upon this question again, 2 years later. One use case should be the eddystone application, where the address shall be changed constantly for privacy reason. I looked into Nordic Eddystone implementation and BLE_GAP_ADDR_TYPE_PUBLIC was used, which is wrong and should be private non resolvable address.

    I however cannot manage to set the address to BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE, even if I have set the MSB 2 bits to 0x00. Error number 12802 (BLE_ERROR_GAP_INVALID_BLE_ADDR). SD 6.1, SDK 15.2. Is there any example in SDK that managed to set address type to BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE? Thanks!

Children
Related