Configuring Multiple Advertising Sets with Unique Random Static Addresses

Hello Nordic DevZone Community,

I am currently working on a project using the nRF52840 DK with NCS V2.1.0 and I’ve encountered a challenge that I hope to get some insights on.

I have successfully implemented the multiple_adv_sets sample to create two advertising sets: one for iBeacon and another for Eddystone. My goal is to have each advertising set broadcast with its own unique random static address, which should be changeable from the code.

Here is the snippet where I set up a random static address:

void main(){
...
bt_addr_le_t addr;
int err = bt_addr_le_from_str("FF:EE:DD:CC:BB:AA", "random", &addr);
if (err) {
    printk("Invalid BT address (err %d)\n", err);
}
err = bt_id_create(&addr, NULL);
if (err < 0) {
    printk("Creating new ID failed (err %d)\n", err);
}

err = bt_enable(NULL);
if (err) {
    printk("Bluetooth init failed (err %d)\n", err);
    return 0;
}
...
}


However, I am unsure how to assign each advertising set its own random static address and have them broadcast separately. I would like to see the iBeacon with one MAC address and the Eddystone with another, both of which I can modify in the code.

I would greatly appreciate any guidance or examples on how to achieve this with NCS V2.1.0 .

Parents Reply Children
No Data
Related