Skip to content

Commit

Permalink
applications: nrf_desktop: Support passthrough reports in hid state
Browse files Browse the repository at this point in the history
Allow the hid state module to handle reports created by external
modules.
These reports will still be sent according to the his state rules.

Signed-off-by: Pawel Dunaj <[email protected]>
  • Loading branch information
pdunaj committed Jan 8, 2025
1 parent 1133ff3 commit 911b0e4
Show file tree
Hide file tree
Showing 4 changed files with 234 additions and 175 deletions.
15 changes: 15 additions & 0 deletions applications/nrf_desktop/configuration/common/hid_report_desc.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,32 @@ enum report_id {

/** @brief Input reports map. */
static const uint8_t input_reports[] = {
#if CONFIG_DESKTOP_HID_REPORT_MOUSE_SUPPORT || CONFIG_DESKTOP_HID_BOOT_INTERFACE_MOUSE
REPORT_ID_MOUSE,
#endif
#if CONFIG_DESKTOP_HID_REPORT_KEYBOARD_SUPPORT || CONFIG_DESKTOP_HID_BOOT_INTERFACE_KEYBOARD
REPORT_ID_KEYBOARD_KEYS,
#endif
#if CONFIG_DESKTOP_HID_REPORT_SYSTEM_CTRL_SUPPORT
REPORT_ID_SYSTEM_CTRL,
#endif
#if CONFIG_DESKTOP_HID_REPORT_CONSUMER_CTRL_SUPPORT
REPORT_ID_CONSUMER_CTRL,
#endif
/* Keep boot reports at the end as these don't have own data. */
#if CONFIG_DESKTOP_HID_BOOT_INTERFACE_MOUSE
REPORT_ID_BOOT_MOUSE,
#endif
#if CONFIG_DESKTOP_HID_BOOT_INTERFACE_KEYBOARD
REPORT_ID_BOOT_KEYBOARD,
#endif
};

/** @brief Output reports map. */
static const uint8_t output_reports[] = {
#if CONFIG_DESKTOP_HID_REPORT_KEYBOARD_SUPPORT
REPORT_ID_KEYBOARD_LEDS,
#endif
};

/* Internal definitions used to calculate size of the biggest supported HID input report. */
Expand Down
10 changes: 10 additions & 0 deletions applications/nrf_desktop/src/modules/Kconfig.hid_state
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ config DESKTOP_HID_EVENT_QUEUE_SIZE
help
Size of the HID event queue.

config DESKTOP_HID_STATE_RAW_REPORTS
bool
help
This option should be selected if the application code issue reports
prepared outside of the HID state module.
The HID state module will work as proxy collecting and holding such
reports.
The HID state will not alter the data but will make sure the reports
are sent to the transport in an organized manner.

module = DESKTOP_HID_STATE
module-str = HID state
source "subsys/logging/Kconfig.template.log_config"
Expand Down
Loading

0 comments on commit 911b0e4

Please sign in to comment.