Bluetooth: LE Advertising Report with channel index
This sample demonstrates channel index append to standard HCI LE Advertising Report events using the SoftDevice Controller proprietary extension.
Enable the feature at build time with
CONFIG_BT_CTLR_SDC_CHAN_IDX_IN_ADV_REPORT and
CONFIG_BT_HCI_ADV_REPORT_CHAN_IDX. The controller links the
feature via sdc_support_chan_idx_in_adv_report() and appends a
chan_idx octet after rssi in standard LE Advertising Report events. The
scan receive callback exposes the value in
bt_le_scan_recv_info.chan_idx.
Requirements
The sample supports the following development kits:
Hardware platforms |
PCA |
Board name |
|
|---|---|---|---|
PCA10188 |
|
||
PCA10184 |
|
||
PCA10226 |
|
||
PCA10156 |
|
||
PCA10156 |
|
||
PCA10156 |
|
||
PCA10175 |
|
||
PCA10095 |
|
||
PCA10040 |
|
||
PCA10056 |
|
You need one development kit running this scanner sample and a nearby device advertising legacy advertising PDUs (any standard Zephyr/nRF advertiser sample works).
Building and running
This sample can be found under samples/bluetooth/le_adv_report_chan_idx in the nRF Connect SDK folder structure.
To build the sample, follow the instructions in Building an application for your preferred building environment. See also Programming an application for programming steps and Testing and optimization for general information about testing and debugging in the nRF Connect SDK.
Note
When building repository applications in the SDK repositories, building with sysbuild is enabled by default.
If you work with out-of-tree freestanding applications, you need to manually pass the --sysbuild parameter to every build command or configure west to always use it.
When building this sample with Sysbuild for an SoC that has a network core, the IPC radio firmware is automatically applied to the build.
The IPC radio is one of the companion components in the nRF Connect SDK and allows to use the radio peripheral from another core in a multicore device.
If needed, you can modify the IPC radio configuration in the prj.conf source file in the sample’s sysbuild/ipc_radio directory.
Testing
When an advertiser is nearby, the scanner console shows advertising reports with channel index values.
Sample output
The output should look similar to the following:
LE Advertising Report with Channel Index sample
Starting scan
scan_recv: Device found: ... (chan_idx 37 RSSI -45), type 0, AD data len 31