I am using S120 SoftDevice on PCA10001 board with sdk7. I want to know on which channel i am receiving advertisement packets.
Is there any API on Central/Observer to which channel it receives advertisement packets.
I am using S120 SoftDevice on PCA10001 board with sdk7. I want to know on which channel i am receiving advertisement packets.
Is there any API on Central/Observer to which channel it receives advertisement packets.
Hi,
The SoftDevice will scan all three advertising channels, and there is no API to get the channel where the advertisement packet was received on. The information that the SoftDevice gives you about the packet can be found in ble_gap_evt_adv_report_t.
Hello Sigurd, is there any method to get the channel where the advertisement packet was received on? Or will Nordic Team add the API of this function in next version? (nRF52) Thanks.
Hi sara,
Unfortunately, the SoftDevice does not support scanning (central role) on specific channels. There is currently no plan to add this functionality, but it may change in the coming months. Note that you can specify the advertising channel when advertising (peripheral role) using ble_gap_adv_params_t::ble_gap_adv_ch_mask_t when you call sd_ble_gap_adv_start().
Hello Sigurd, refer to the link [https://devzone.nordicsemi.com/question/49420/scan-in-a-single-channel/]
Does it mean that it can't get the channel where the advertisement packets was received on, but it can ONLY scan on the specific channel? Although I still don't know what the channel is scanned in the sample code from that link.
Thanks again.
Hi sara,
It will by default scan on all 3 advertising channels (37, 38, 39). It will change channel each time ll_scan_start()
is called, but you can set it to scan on one specific channel by calling radio_init(channel)
with the channel you want to scan. See line 534 here.