|
| 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` |
0 commit comments