Skip to content

Commit 8c1e51a

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 98f6462 commit 8c1e51a

8 files changed

Lines changed: 572 additions & 0 deletions

File tree

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

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

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

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: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
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 updates its host channel map every five seconds by disabling three randomly selected data channels using the standard :c:func:`bt_le_set_chan_map` API.
23+
24+
The central enables channel classification reporting using the NCS host extension API and applies the received classification back to its own channel map.
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 with three disabled channels.
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-01855506eea2 ***
58+
*** Using Zephyr OS v4.4.99-bf52a9edec7e ***
59+
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+
Bluetooth initialized
72+
Choose device role - type c (central) or p (peripheral):
73+
Selected Peripheral
74+
Advertising successfully started
75+
Connected as peripheral
76+
Disabled channels: 14, 4, 15
77+
Peripheral channel map ef 3f ff ff 1f
78+
Disabled channels: 15, 0, 31
79+
Peripheral channel map fe 7f ff 7f 1f
80+
81+
Example central output::
82+
83+
*** Booting nRF Connect SDK v3.4.99-01855506eea2 ***
84+
*** Using Zephyr OS v4.4.99-bf52a9edec7e ***
85+
Starting Bluetooth Channel Classification sample
86+
I: SoftDevice Controller build revision:
87+
I: 2e 0b 04 cf 06 5e 2e 8f |.....^..
88+
I: a8 14 89 4d b6 1b 7a 8c |...M..z.
89+
I: d4 e4 bb 1f |....
90+
I: HW Platform: Nordic Semiconductor (0x0002)
91+
I: HW Variant: nRF54Lx (0x0005)
92+
I: Firmware: Standard Bluetooth controller (0x00) Version 46.1035 Build 777914063
93+
I: HCI transport: SDC
94+
I: Identity: F1:6C:D4:5E:80:EA (random)
95+
I: HCI: version 6.3 (0x11) revision 0x306a, manufacturer 0x0059
96+
I: LMP: version 6.3 (0x11) subver 0x306a
97+
Bluetooth initialized
98+
Choose device role - type c (central) or p (peripheral):
99+
Selected Central
100+
Scanning successfully started
101+
Filters matched. Address: E9:A2:74:BE:64:BA (random) connectable: 1
102+
Connecting...
103+
Connected as central
104+
Channel classification reporting enabled
105+
Central channel map from report ff ff ff ff 1f
106+
Central applied peripheral channel classification
107+
Central channel map from report ef 3f ff ff 1f
108+
Central applied peripheral channel classification
109+
110+
Dependencies
111+
************
112+
113+
This sample uses the following |NCS| libraries:
114+
115+
* :file:`include/bluetooth/nrf/host_extensions.h`
116+
117+
This sample uses the following `sdk-nrfxlib`_ libraries:
118+
119+
* :ref:`nrfxlib:softdevice_controller`
120+
121+
In addition, it uses the following Zephyr libraries:
122+
123+
* :ref:`zephyr:bluetooth_api`
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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_NRF_CHANNEL_CLASSIFICATION=y
21+
22+
CONFIG_BT_SCAN=y
23+
CONFIG_BT_SCAN_FILTER_ENABLE=y
24+
CONFIG_BT_SCAN_NAME_CNT=1
25+
26+
CONFIG_HEAP_MEM_POOL_SIZE=2048
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
sample:
2+
description: Bluetooth Low Energy Channel Classification sample
3+
name: Bluetooth LE Channel Classification
4+
tests:
5+
sample.bluetooth.channel_classification:
6+
sysbuild: true
7+
integration_platforms:
8+
- nrf52840dk/nrf52840
9+
- nrf5340dk/nrf5340/cpuapp
10+
- nrf54l15dk/nrf54l15/cpuapp
11+
platform_allow:
12+
- nrf52840dk/nrf52840
13+
- nrf5340dk/nrf5340/cpuapp
14+
- nrf5340dk/nrf5340/cpuapp/ns
15+
- nrf54l15dk/nrf54l15/cpuapp
16+
tags:
17+
- bluetooth
18+
- ci_build
19+
- sysbuild
20+
- ci_samples_bluetooth
21+
harness: console
22+
harness_config:
23+
type: multi_line
24+
ordered: true
25+
regex:
26+
- "Starting Bluetooth Channel Classification sample"
27+
- "Bluetooth initialized"
28+
timeout: 15

0 commit comments

Comments
 (0)