Skip to content

Commit 86efb25

Browse files
committed
samples: bluetooth: HID SCI support in HID samples
This commit adds usage of the HID SCI feature in the central_hids sample as well as support for the HID SCI characteristics in the peripheral_hids_mouse and peripheral_hids_keyboard samples. Signed-off-by: Artur Hadasz <artur.hadasz@nordicsemi.no>
1 parent 7f697f5 commit 86efb25

12 files changed

Lines changed: 535 additions & 30 deletions

File tree

samples/bluetooth/central_hids/README.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ User interface
6969
This function is available only if the connected HID has boot keyboard reports.
7070
It always writes CAPSLOCK information to the boot report, even if Report Protocol Mode is selected.
7171

72+
Button 4:
73+
Switch to the "Additional button functions" mode.
74+
In this mode the buttons have different functionalities:
75+
- Button 2 (HID SCI configuration only): Switch to the next SCI mode (Currently only supported in HID SCI configuration).
76+
- Button 4: Exit the "Additional button functions" mode.
77+
7278
.. group-tab:: nRF54 DKs
7379

7480
Button 0:
@@ -88,12 +94,20 @@ User interface
8894
This function is available only if the connected HID has boot keyboard reports.
8995
It always writes CAPSLOCK information to the boot report, even if Report Protocol Mode is selected.
9096

97+
Button 3:
98+
Switch to the "Additional button functions" mode.
99+
In this mode the buttons have different functionalities:
100+
- Button 1 (HID SCI configuration only): Switch to the next SCI mode (Currently only supported in HID SCI configuration).
101+
- Button 3: Exit the "Additional button functions" mode.
102+
91103
Building and Running
92104
********************
93105
.. |sample path| replace:: :file:`samples/bluetooth/central_hids`
94106

95107
.. include:: /includes/build_and_run_ns.txt
96108

109+
To build the sample with HID SCI support, build with ``-DEXTRA_CONF_FILE=hid_sci.conf``
110+
97111
Testing
98112
=======
99113

@@ -110,6 +124,7 @@ Testing with another development kit
110124
1. |connect_terminal_specific|
111125
#. Reset the kit.
112126
#. Program the other kit with the :ref:`peripheral_hids_keyboard` sample and reset it.
127+
#. If you see "NFC configuration done" on the peripheral kit, press **Button 4** on the peripheral kit in order for it to start advertising.
113128
#. When connected, press **Button 1** on both devices to confirm the passkey value used for bonding, or press **Button 2** to reject it.
114129
#. Wait until the HIDS keyboard is detected by the central.
115130
All detected descriptors are listed.
@@ -153,6 +168,7 @@ Testing with another development kit
153168
1. |connect_terminal_specific|
154169
#. Reset the kit.
155170
#. Program the other kit with the :ref:`peripheral_hids_keyboard` sample and reset it.
171+
#. If you see "NFC configuration done" on the peripheral kit, press **Button 3** on the peripheral kit in order for it to start advertising.
156172
#. When connected, press **Button 0** on both devices to confirm the passkey value used for bonding, or press **Button 1** to reject it.
157173
#. Wait until the HIDS keyboard is detected by the central.
158174
All detected descriptors are listed.
@@ -291,6 +307,32 @@ Testing with Bluetooth Low Energy app
291307
#. Press **Button 1** on the kit and observe that the **Protocol Mode** value changes from ``01`` to ``00``.
292308
#. Press **Button 0** and **Button 2** one after another and observe that the **Boot Keyboard Output Report** value toggles between ``00`` and ``02``.
293309

310+
Testing with HID SCI support
311+
----------------------------
312+
313+
To test the sample with HID SCI support, both the central and the peripheral must be built with ``-DEXTRA_CONF_FILE=hid_sci.conf``
314+
315+
.. group-tab:: nRF54 DKs
316+
317+
1. |connect_terminal_specific|
318+
#. Reset the kit.
319+
#. Program the other kit with the :ref:`peripheral_hids_keyboard` sample and reset it.
320+
#. If you see "NFC configuration done" on the peripheral kit, press **Button 3** on the peripheral kit in order for it to start advertising.
321+
#. When connected, press **Button 0** on both devices to confirm the passkey value used for bonding, or press **Button 1** to reject it.
322+
#. Wait until the HIDS keyboard is detected by the central.
323+
Check for information similar to the following::
324+
325+
HIDS is ready to work
326+
Subscribe in report id: 1
327+
Subscribe in boot keyboard report
328+
#. Press **Button 4** on the central kit and wait for the SCI mode to change to DEFAULT.
329+
#. Cycle through the HID SCI modes by pressing **Button 4** on the central kit.
330+
The HID SCI mode will change to FAST, LOW POWER, FULL RANGE, and DEFAULT again.
331+
Every time you might need to wait a few seconds for the mode to change.
332+
You will see a message similar to the following::
333+
334+
SCI mode changed notification received, new mode: <mode_name>
335+
294336
Dependencies
295337
*************
296338

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS=n
2+
3+
CONFIG_BT_SUBRATING=y
4+
CONFIG_BT_LE_EXTENDED_FEAT_SET=y
5+
CONFIG_BT_SHORTER_CONNECTION_INTERVALS=y
6+
7+
CONFIG_BT_HOGP_SCI=y

samples/bluetooth/central_hids/sample.yaml

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
sample:
22
description: Bluetooth Low Energy central Human Interface Device sample
33
name: Bluetooth LE Central HIDS
4+
common:
5+
sysbuild: true
6+
harness: console
7+
harness_config:
8+
type: multi_line
9+
ordered: true
10+
regex:
11+
- "Starting Bluetooth Central HIDS sample"
12+
- "Bluetooth initialized"
13+
- "Scanning successfully started"
14+
timeout: 15
15+
tags:
16+
- bluetooth
17+
- ci_build
18+
- sysbuild
19+
- ci_samples_bluetooth
420
tests:
521
sample.bluetooth.central_hids:
622
sysbuild: true
@@ -25,17 +41,16 @@ tests:
2541
- nrf54lv10dk/nrf54lv10a/cpuapp
2642
- nrf54lv10dk/nrf54lv10a/cpuapp/ns
2743
- nrf54h20dk/nrf54h20/cpuapp
28-
tags:
29-
- bluetooth
30-
- ci_build
31-
- sysbuild
32-
- ci_samples_bluetooth
33-
harness: console
34-
harness_config:
35-
type: multi_line
36-
ordered: true
37-
regex:
38-
- "Starting Bluetooth Central HIDS sample"
39-
- "Bluetooth initialized"
40-
- "Scanning successfully started"
41-
timeout: 15
44+
sample.bluetooth.central_hids.hid_sci:
45+
sysbuild: true
46+
integration_platforms:
47+
- nrf54l15dk/nrf54l05/cpuapp
48+
- nrf54lm20dk/nrf54lm20a/cpuapp
49+
- nrf54lm20dk/nrf54lm20b/cpuapp
50+
- nrf54lv10dk/nrf54lv10a/cpuapp
51+
platform_allow:
52+
- nrf54l15dk/nrf54l05/cpuapp
53+
- nrf54lm20dk/nrf54lm20a/cpuapp
54+
- nrf54lm20dk/nrf54lm20b/cpuapp
55+
- nrf54lv10dk/nrf54lv10a/cpuapp
56+
extra_args: EXTRA_CONF_FILE=hid_sci.conf

0 commit comments

Comments
 (0)