Bluetooth: Channel Classification
The Channel Classification sample demonstrates Channel Classification reporting between a central and a peripheral.
Requirements
The sample supports the following development kits:
Hardware platforms |
PCA |
Board name |
|
|---|---|---|---|
nRF54LV10 DK |
PCA10188 |
|
|
PCA10184 |
|
||
nRF54LC10 DK |
PCA10226 |
nrf54lc10dk |
|
PCA10156 |
|
||
PCA10156 |
|
||
PCA10156 |
|
||
PCA10175 |
|
||
PCA10095 |
|
||
PCA10056 |
|
You can use any combination of the development kits mentioned in this sample in your testing setup.
Additionally, the sample requires a connection to a computer with a serial terminal for each of the development kits.
Overview
When connected, the peripheral cycles through three predefined host channel classifications, submitting a new one every five seconds.
The central enables reporting with hci_vs_sdc_channel_reporting_enable(), receives each report from the peripheral in a HCI VS event callback, and applies the peripheral’s channel classification to the connection.
Building and running
This sample can be found under samples/bluetooth/channel_classification 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
After programming the sample to both development kits, test it by performing the following steps:
Connect to both kits with a terminal emulator (for example, the Serial Terminal app). See Testing and optimization for the required settings and steps.
Reset both kits.
Start the application on the connected board in the central role by typing
cin one of the terminal emulators.Start the application in the peripheral role by typing
pin the other terminal emulator.Observe that the kits establish a connection.
Observe a new channel classification printed every five seconds on the peripheral.
Observe that the central prints a matching channel classification from the received classification reports and applies it as a channel map.
Sample output
The following is an example of the peripheral output:
*** Booting nRF Connect SDK v3.4.99-b15b0977d5d7 ***
*** Using Zephyr OS v4.4.99-bf52a9edec7e ***
I: Starting Bluetooth Channel Classification sample
I: SoftDevice Controller build revision:
I: 2e 0b 04 cf 06 5e 2e 8f |.....^..
I: a8 14 89 4d b6 1b 7a 8c |...M..z.
I: d4 e4 bb 1f |....
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF54Lx (0x0005)
I: Firmware: Standard Bluetooth controller (0x00) Version 46.1035 Build 777914063
I: HCI transport: SDC
I: Identity: E9:A2:74:BE:64:BA (random)
I: HCI: version 6.3 (0x11) revision 0x306a, manufacturer 0x0059
I: LMP: version 6.3 (0x11) subver 0x306a
I: Bluetooth initialized
I: Choose device role - type c (central) or p (peripheral):
I:
I: Selected Peripheral
I: Advertising successfully started
I: Connected as peripheral
I: Using channel map 0
I: Peripheral channel map ff ff ff ff 1f
I: Using channel map 1
I: Peripheral channel map ff fb ef bf 1f
I: Using channel map 2
I: Peripheral channel map df 7f ff fd 1f
The following is an example of the central output:
*** Booting nRF Connect SDK v3.4.99-b15b0977d5d7 ***
*** Using Zephyr OS v4.4.99-bf52a9edec7e ***
I: Starting Bluetooth Channel Classification sample
I: SoftDevice Controller build revision:
I: 2e 0b 04 cf 06 5e 2e 8f |.....^..
I: a8 14 89 4d b6 1b 7a 8c |...M..z.
I: d4 e4 bb 1f |....
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF54Lx (0x0005)
I: Firmware: Standard Bluetooth controller (0x00) Version 46.1035 Build 777914063
I: HCI transport: SDC
I: Identity: F1:6C:D4:5E:80:EA (random)
I: HCI: version 6.3 (0x11) revision 0x306a, manufacturer 0x0059
I: LMP: version 6.3 (0x11) subver 0x306a
I: Bluetooth initialized
I: Choose device role - type c (central) or p (peripheral):
I:
I: Selected Central
I: Scanning successfully started
I: Filters matched. Address: E9:A2:74:BE:64:BA (random) connectable: 1
I: Connected as central
I: Channel classification reporting enabled
I: Central channel map from report ff ff ff ff 1f
I: Central applied peripheral channel classification
I: Central channel map from report ff fb ef bf 1f
I: Central applied peripheral channel classification
I: Central channel map from report df 7f ff fd 1f
Dependencies
This sample uses the following nRF Connect SDK library:
include/bluetooth/hci_vs_sdc.h
This sample uses the following sdk-nrfxlib libraries:
In addition, it uses the following Zephyr libraries: