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

Periodically changing the MAC address on nRF51822 Beacon Kit

Hi,

I am able to change the MAC address of the beacon using the call sd_ble_gap_address_set(BLE_GAP_ADDR_CYCLE_MODE_NONE, &gap_addr), where gap_addr is of type BLE_GAP_ADDR_TYPE_RANDOM_STATIC.

Now what I want to do is to change the MAC address periodically, while the beacon is still advertising. From what I understand, I need to use sd_ble_gap_address_set(BLE_GAP_ADDR_CYCLE_MODE_AUTO, &gap_addr), with an address of type BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE. However, the MAC address seems to change only during the boot up and when the SW2 button is pressed (changes one when beacon goes into config mode and once when beacon switches back to advertising). I set the BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S to 5 to be able to observe the change. I am calling the sd_ble_gap_address_set function after ble_stack_init() call in the main function of the sample beacon app.

What should I do to achieve periodic change of MAC address? Can this be achieved with LE_GAP_ADDR_CYCLE_MODE_AUTO mode at all, or should I simply set up a timer, create random MAC address and call sd_ble_gap_address_set(BLE_GAP_ADDR_CYCLE_MODE_NONE, &gap_addr) every time timer expires?

Thanks for your help in advance.

Parents Reply Children
No Data
Related