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

Update advertising data in radio pre activation hook

When I update the advertising data from the radio pre activation hook (800µs), the updated data does not appear in the advertising event following 800 µs after the hook is called, but in the next advertising event. This way, if I use my device as a broadcaster, my data is outdated by one advertising interval.

I am calling

sd_ble_gap_adv_data_set(p_adv_data, adv_data_length, NULL, 0);

directly at the beginning of the hook. The adverdata length is 29 bytes. I do not calculate anything here, I just set the buffer as raw advertising data.

The radio pre activation hook interrupt priority is NRF_APP_PRIORITY_LOW, of course. Otherwise, I wouldn't be able to call sd_ble_gap_adv_data_set() successfully.

Is this a bug? Or is there any other way to set the advertising / broadcast data just a moment before the real advertising cycle starts? Advertising intervals may be up to 10 seconds long, so it would be regrettable if there was no possibility to update the advertising data just before it is sent out.

By the way, I am using SoftDevice S110 v7.1.0.

Related