Skip to content

Commit 9429fd6

Browse files
committed
samples: bluetooth: Add Channel Classification sample
This sample demonstrates a usecase for channel classification. The sample shows the central receiving channel classification reports from the peripheral and applying them in a channel map update. Signed-off-by: Timothy Keys <timothy.keys@nordicsemi.no>
1 parent dfa6319 commit 9429fd6

9 files changed

Lines changed: 581 additions & 0 deletions

File tree

CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@
516516
/samples/bluetooth/central_nfc_pairing/ @nrfconnect/ncs-blenders
517517
/samples/bluetooth/central_smp_client/ @nrfconnect/ncs-eris
518518
/samples/bluetooth/central_uart/ @nrfconnect/ncs-blenders
519+
/samples/bluetooth/channel_classification/ @nrfconnect/ncs-dragoon
519520
/samples/bluetooth/channel_sounding/ @nrfconnect/ncs-dragoon
520521
/samples/bluetooth/conn_time_sync/ @nrfconnect/ncs-dragoon
521522
/samples/bluetooth/direction_finding_central/ @nrfconnect/ncs-dragoon
@@ -641,6 +642,7 @@
641642
/samples/bluetooth/central_nfc_pairing/*.rst @nrfconnect/ncs-blenders-doc
642643
/samples/bluetooth/central_smp_client/*.rst @nrfconnect/ncs-eris-doc
643644
/samples/bluetooth/central_uart/*.rst @nrfconnect/ncs-blenders-doc
645+
/samples/bluetooth/channel_classification/*.rst @nrfconnect/ncs-dragoon-doc
644646
/samples/bluetooth/channel_sounding/ras_initiator/*.rst @nrfconnect/ncs-dragoon-doc
645647
/samples/bluetooth/channel_sounding/ras_reflector/*.rst @nrfconnect/ncs-dragoon-doc
646648
/samples/bluetooth/channel_sounding/ipt_initiator/*.rst @nrfconnect/ncs-dragoon-doc

doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,8 @@ Bluetooth samples
330330
* Updated the minimum supported connection interval from 875 µs to 750 µs in the HID SCI configuration.
331331
* Enabled the Frame Space Update feature in the single peripheral HID SCI configuration.
332332

333+
* Added the :ref:`ble_channel_classification` sample that demonstrates peripheral-initiated channel map updates and central reception of channel classification reports.
334+
333335
Bluetooth Mesh samples
334336
----------------------
335337

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# Copyright (c) 2026 Nordic Semiconductor
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
cmake_minimum_required(VERSION 3.20.0)
8+
9+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
10+
project(bluetooth_channel_classification)
11+
12+
target_sources(app PRIVATE src/main.c)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Copyright (c) 2026 Nordic Semiconductor
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
config NRF_DEFAULT_IPC_RADIO
8+
default y
9+
10+
config NETCORE_IPC_RADIO_BT_HCI_IPC
11+
default y
12+
13+
source "share/sysbuild/Kconfig"
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
.. _ble_channel_classification:
2+
3+
.. ncs-sample::
4+
:title: Bluetooth: Channel Classification
5+
6+
This sample demonstrates LE Channel Classification reporting between a central and a peripheral.
7+
8+
Requirements
9+
************
10+
11+
The sample supports the following development kits:
12+
13+
.. table-from-sample-yaml::
14+
15+
You can use any combination of the development kits mentioned above in your testing setup.
16+
17+
Additionally, the sample requires a connection to a computer with a serial terminal for each of the development kits.
18+
19+
Overview
20+
********
21+
22+
When connected, the peripheral cycles through predefined host channel maps, changing every five seconds.
23+
24+
The central enables channel classification reporting using :c:func:`hci_vs_sdc_channel_reporting_enable` and handles the received reports in a local HCI VS event callback.
25+
26+
Building and running
27+
********************
28+
29+
.. |sample path| replace:: :file:`samples/bluetooth/channel_classification`
30+
31+
.. include:: /includes/build_and_run.txt
32+
33+
.. |sample_or_app| replace:: sample
34+
.. |ipc_radio_dir| replace:: :file:`sysbuild/ipc_radio`
35+
36+
.. include:: /includes/ipc_radio_conf.txt
37+
38+
Testing
39+
=======
40+
41+
After programming the sample to both development kits, test it by performing the following steps:
42+
43+
1. Connect to both kits with a terminal emulator (for example, the `Serial Terminal app`_).
44+
See :ref:`test_and_optimize` for the required settings and steps.
45+
#. Reset both kits.
46+
#. In one of the terminal emulators, type ``c`` to start the application on the connected board in the central role.
47+
#. In the other terminal emulator, type ``p`` to start the application in the peripheral role.
48+
#. Observe that the kits establish a connection.
49+
#. On the peripheral, observe a new channel map printed every five seconds.
50+
#. On the central, observe matching channel maps applied from the received classification reports.
51+
52+
Sample output
53+
=============
54+
55+
Example peripheral output::
56+
57+
*** Booting nRF Connect SDK v3.4.99-b15b0977d5d7 ***
58+
*** Using Zephyr OS v4.4.99-bf52a9edec7e ***
59+
I: Starting Bluetooth Channel Classification sample
60+
I: SoftDevice Controller build revision:
61+
I: 2e 0b 04 cf 06 5e 2e 8f |.....^..
62+
I: a8 14 89 4d b6 1b 7a 8c |...M..z.
63+
I: d4 e4 bb 1f |....
64+
I: HW Platform: Nordic Semiconductor (0x0002)
65+
I: HW Variant: nRF54Lx (0x0005)
66+
I: Firmware: Standard Bluetooth controller (0x00) Version 46.1035 Build 777914063
67+
I: HCI transport: SDC
68+
I: Identity: E9:A2:74:BE:64:BA (random)
69+
I: HCI: version 6.3 (0x11) revision 0x306a, manufacturer 0x0059
70+
I: LMP: version 6.3 (0x11) subver 0x306a
71+
I: Bluetooth initialized
72+
I: Choose device role - type c (central) or p (peripheral):
73+
I:
74+
I: Selected Peripheral
75+
I: Advertising successfully started
76+
I: Connected as peripheral
77+
I: Using channel map 0
78+
I: Peripheral channel map ff ff ff ff 1f
79+
I: Using channel map 1
80+
I: Peripheral channel map ff fb ef bf 1f
81+
I: Using channel map 2
82+
I: Peripheral channel map df 7f ff fd 1f
83+
84+
Example central output::
85+
86+
*** Booting nRF Connect SDK v3.4.99-b15b0977d5d7 ***
87+
*** Using Zephyr OS v4.4.99-bf52a9edec7e ***
88+
I: Starting Bluetooth Channel Classification sample
89+
I: SoftDevice Controller build revision:
90+
I: 2e 0b 04 cf 06 5e 2e 8f |.....^..
91+
I: a8 14 89 4d b6 1b 7a 8c |...M..z.
92+
I: d4 e4 bb 1f |....
93+
I: HW Platform: Nordic Semiconductor (0x0002)
94+
I: HW Variant: nRF54Lx (0x0005)
95+
I: Firmware: Standard Bluetooth controller (0x00) Version 46.1035 Build 777914063
96+
I: HCI transport: SDC
97+
I: Identity: F1:6C:D4:5E:80:EA (random)
98+
I: HCI: version 6.3 (0x11) revision 0x306a, manufacturer 0x0059
99+
I: LMP: version 6.3 (0x11) subver 0x306a
100+
I: Bluetooth initialized
101+
I: Choose device role - type c (central) or p (peripheral):
102+
I:
103+
I: Selected Central
104+
I: Scanning successfully started
105+
I: Filters matched. Address: E9:A2:74:BE:64:BA (random) connectable: 1
106+
I: Connected as central
107+
I: Channel classification reporting enabled
108+
I: Central channel map from report ff ff ff ff 1f
109+
I: Central applied peripheral channel classification
110+
I: Central channel map from report ff fb ef bf 1f
111+
I: Central applied peripheral channel classification
112+
I: Central channel map from report df 7f ff fd 1f
113+
114+
Dependencies
115+
************
116+
117+
This sample uses the following |NCS| library:
118+
119+
* :file:`include/bluetooth/hci_vs_sdc.h`
120+
121+
This sample uses the following `sdk-nrfxlib`_ libraries:
122+
123+
* :ref:`nrfxlib:softdevice_controller`
124+
125+
In addition, it uses the following Zephyr libraries:
126+
127+
* :ref:`zephyr:bluetooth_api`
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#
2+
# Copyright (c) 2026 Nordic Semiconductor
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
CONFIG_NCS_SAMPLES_DEFAULTS=y
7+
8+
CONFIG_CONSOLE=y
9+
CONFIG_CONSOLE_SUBSYS=y
10+
CONFIG_CONSOLE_HANDLER=y
11+
CONFIG_CONSOLE_GETCHAR=y
12+
13+
CONFIG_BT_DEVICE_NAME="Nordic_Channel_Class"
14+
CONFIG_BT=y
15+
CONFIG_BT_PERIPHERAL=y
16+
CONFIG_BT_CENTRAL=y
17+
CONFIG_BT_MAX_CONN=1
18+
19+
CONFIG_BT_CTLR_CHANNEL_CLASSIFICATION=y
20+
CONFIG_BT_HCI_VS_EVT_USER=y
21+
22+
CONFIG_BT_SCAN=y
23+
CONFIG_BT_SCAN_FILTER_ENABLE=y
24+
CONFIG_BT_SCAN_NAME_CNT=1

0 commit comments

Comments
 (0)