6 years, 1 month ago.

Nordic nRF51822 BLE Advertisement Channel Example

Can someone provide an example of how to use the Nordic Timeslot API to advertise on only one channel (e.g. 37)? From what I have read on the Nordic DevZone website, this is possible. However, I cannot find any examples of how to do this. Perhaps alternately to the Timeslot API, in the standard nrf51822 library that's used with most mbed examples on here, there is a header file under softdevice | s130 called "ble_gap.h" and in that header there is a ble_gap_adv_ch_mask_t struct that's part of the ble_gap_adv_params_t. That channel mask struct has flags for each of the 3 advertising channels, and the comments around that struct say that if you set those flags to "1" it will disable scanning and/or advertising on that channel. So my question is: Can someone show me an example of how to do that? I'd like to spin up a beacon example that is only advertising on a single channel.

1 Answer

6 years ago.

Hi Adam,

You might check out the Mbed OS examples repository for the BLE API here: https://github.com/ARMmbed/mbed-os-example-ble

Please let me know if you have any questions!

- Jenny, team Mbed