Skip to content

Commit f0824ef

Browse files
MarekPietanordicjm
authored andcommitted
applications: nrf_desktop: Update HID state module doc
Change updates HID state module documentation to inform about HID eventq utility integration. Jira: NCSDK-33578 Signed-off-by: Marek Pieta <[email protected]> Signed-off-by: Divya Pillai <[email protected]>
1 parent fca96de commit f0824ef

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

applications/nrf_desktop/doc/hid_state.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,14 @@ Report expiration
119119
=================
120120

121121
With the :ref:`CONFIG_DESKTOP_HID_REPORT_EXPIRATION <config_desktop_app_options>` Kconfig option, you can set the amount of time after which a key will be considered expired.
122-
The higher the value, the longer the period after which the nRF Desktop application will recall pressed keys when the connection is established.
122+
The higher the value, the longer the period from which the nRF Desktop application will recall pressed keys when the connection with HID host is established.
123123

124124
Queue event size
125125
================
126126

127+
The module selects the :ref:`CONFIG_DESKTOP_HID_EVENTQ <config_desktop_app_options>` Kconfig option to enable the :ref:`nrf_desktop_hid_eventq`.
128+
The utility is used to temporarily queue key state changes (presses and releases) before the connection with the HID host is established.
129+
127130
With the :ref:`CONFIG_DESKTOP_HID_EVENT_QUEUE_SIZE <config_desktop_app_options>` Kconfig option, you can set the number of elements on the queue where the keys are stored before the connection is established.
128131
When a key state changes (it is pressed or released) before the connection is established, an element containing this key's usage is pushed onto the queue.
129132
If there is no space in the queue, the oldest element is released.
@@ -147,7 +150,6 @@ For the routing mechanism to work, the module performs the following operations:
147150

148151
Apart from the routing mechanism, the module is also responsible for `Handling HID keyboard LED state`_.
149152

150-
151153
Linking input data with the right HID report
152154
============================================
153155

@@ -187,7 +189,7 @@ This structure is part of the application configuration files for the specific b
187189
Once the mapping is obtained, the application checks if the report to which the usage belongs is connected:
188190

189191
* If the report is connected, the value is stored at the right position in the ``items`` member of :c:struct:`report_data` associated with the report.
190-
* If the report is not connected, the value is stored in the ``eventq`` event queue member of the same structure.
192+
* If the report is not connected, the value is stored in the :ref:`nrf_desktop_hid_eventq` instance in the same structure.
191193

192194
The difference between these operations is that storing value onto the queue (second case) preserves the order of input events.
193195
See the following section for more information about storing data before the connection.
@@ -200,9 +202,9 @@ The storing approach before the connection depends on the data type:
200202
* The relative value data is not stored outside of the connection period.
201203
* The absolute value data is stored before the connection.
202204

203-
The reason for this operation is to allow to track key presses that happen right after the device is woken up, but before it is able to connect to the host.
205+
The reason for this operation is to allow to track key presses that happen right after the device is woken up, but before it is able to connect to the HID host.
204206

205-
When the device is disconnected and the input event with the absolute value data is received, the data is stored onto the event queue (``eventq``), a member of :c:struct:`report_data` structure.
207+
When the device is disconnected and the input event with the absolute value data is received, the data is stored onto the :ref:`nrf_desktop_hid_eventq` instance, a member of :c:struct:`report_data` structure.
206208
This queue preserves an order at which input data events are received.
207209

208210
Storing limitations
@@ -237,7 +239,7 @@ The |hid_state| tracks the state of modules that forward the HID data to a HID h
237239
The |hid_state| refers collectively to all transports as *subscribers*.
238240
When the connection to the host is indicated by this event, the |hid_state| will create a subscriber associated with the transport.
239241
Each subscriber reports its priority as part of the :c:struct:`hid_report_subscriber_event`.
240-
The subscriber priority must be unique, that mean two or more subscriber cannot share the same priority value.
242+
The subscriber priority must be unique, that mean two or more subscribers cannot share the same priority value.
241243

242244
By default, the subscriber that is associated with USB has priority over any Bluetooth LE peer subscriber.
243245
As a result, when the host connected through the USB subscribes for a HID report, the HID report will be routed to the USB.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ nRF Desktop
243243
* Use generic callbacks to handle HID feature and output reports.
244244

245245
This approach simplifies the process of adding support for new HID reports.
246+
* The :ref:`nrf_desktop_hid_state` to use the :ref:`nrf_desktop_hid_eventq` to temporarily queue HID events related to keypresses before connection to the HID host is established.
247+
The feature was implemented directly in HID state module before.
246248

247249
* The default value of the :kconfig:option:`CONFIG_APP_EVENT_MANAGER_MAX_EVENT_CNT` Kconfig option to ``64``.
248250
This ensures that more complex configurations fit in the limit.

0 commit comments

Comments
 (0)