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 Dec 20, 2024
1 parent 3665a25 commit 64dd11a
Show file tree
Hide file tree
Showing 4 changed files with 232 additions and 176 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_REPORT_BOOT_INTERFACE_MOUSE
REPORT_ID_MOUSE,
#endif
#if CONFIG_DESKTOP_HID_REPORT_KEYBOARD_SUPPORT || CONFIG_DESKTOP_HID_REPORT_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_REPORT_BOOT_INTERFACE_MOUSE
REPORT_ID_BOOT_MOUSE,
#endif
#if CONFIG_DESKTOP_HID_REPORT_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
7 changes: 7 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,13 @@ config DESKTOP_HID_EVENT_QUEUE_SIZE
help
Size of the HID event queue.

config DESKTOP_HID_STATE_RAW_REPORTS
bool
help
Enable the HID state module to handle passthrough 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 64dd11a

Please sign in to comment.