Introducing a new way to review your PRs.

Read the announcement

aprilnea / openlogi

⚡️A native, local-first alternative to Logitech Options+, written in Rust 🦀 — remap buttons, DPI, and SmartShift over HID++. No account, no telemetry.

View on GitHub

25 documents · Updated Nov 23, 2026

docs / logitech-hidpp-protocol

Logitech HID++ protocol support

Logitech HID++ support turns Logitech-specific HID reports into typed device operations and capability data. It sits above the raw HID transport described in HID device access and discovery, and supplies the protocol layer used by the broader device integration stack for direct devices and devices reached through wireless receivers. It covers both the HID++ 2.0 feature model and the HID++ 1.0 register model. The runtime view of these devices is described in device-domain runtime, while their shared records are described in the device registry.

Protocol boundary

HID++ channel

The HID++ channel is the boundary between raw HID reports and protocol messages. It accepts a raw HID channel from the transport layer, recognizes the exact short and long HID++ report forms, matches replies to requests, and forwards reports to feature and receiver listeners. Reports with another report ID can share the HID node, so the channel treats them as foreign traffic rather than malformed HID++ (crates/…/channel.rs• L229-239, crates/…/channel.rs• L721-766, crates/…/message.rs• L4-25). The channel also carries the vendor and product identity that later supports receiver detection (crates/…/channel.rs• L237-241).

The raw transport can state its HID++ support directly or let the channel derive it from the HID report descriptor. Descriptor-based detection requires both the HID++ report ID and its matching vendor-defined usage for each short or long report form. This avoids treating a shared HID node as HID++ only because it happens to use a matching report ID (crates/…/raw.rs• L25-31, crates/…/raw.rs• L70-105, crates/…/raw.rs• L108-128).

The channel keeps request handling separate from feature behavior. A request waits for a matching response, while a device notification can become a feature event. Software IDs identify requests on the wire, and ID 0 remains reserved for device notifications. The channel can use a fixed ID, rotate through nonzero IDs, or hold a leased ID when more than one channel may address the same node (crates/…/channel.rs• L131-195). It also exposes the IDs owned by the channel, so a feature can distinguish its own late replies from responses caused by another client (crates/…/channel.rs• L204-227, crates/…/channel.rs• L419-427).

The channel serializes requests that share the device, feature, and software-ID header because the wire cannot tell their replies apart. A timed-out or cancelled request keeps that header reserved until its late reply is discarded or a short grace period ends. A read of immutable state can explicitly reuse an identical outstanding reply, which keeps feature-table walks moving on a lossy link. The pending-request state keeps these active and abandoned replies distinct so a late response cannot satisfy a newer operation (crates/…/channel.rs• L74-113, crates/…/channel.rs• L475-560, crates/…/pending.rs• L25-43).

Requests normally have a time limit that covers registration, the report write, and the wait for a matching response. A write-through mode keeps the native write in order before it starts the response wait, which protects operations that may need a later rollback. A long-only transport can widen a short request before sending it, and the channel also permits bounded raw-report writes for HID++ reports wider than the typed message forms. Raw writes preserve the complete report and reject empty or oversized input before transport I/O (crates/…/channel.rs• L437-451, crates/…/channel.rs• L453-621, crates/…/channel.rs• L653-729, crates/…/raw_and_listeners.rs• L6-88).

The channel also exposes raw report listeners for vendor traffic that shares a HID node with HID++. These listeners see the original report bytes before HID++ parsing and correlation, while typed message listeners see only reports that parse as HID++. Listener removal affects later reports, while a listener already selected for the current dispatch can finish receiving that report. A guarded listener is removed when its guard is dropped (crates/…/channel.rs• L125-136, crates/…/channel.rs• L764-795, crates/…/channel.rs• L831-845, crates/…/raw_and_listeners.rs• L91-119, crates/…/raw_and_listeners.rs• L146-231).

References: crates/…/channel.rs• L74-113 crates/…/channel.rs• L125-136 crates/…/channel.rs• L131-227 crates/…/channel.rs• L229-239 crates/…/channel.rs• L437-451 crates/…/channel.rs• L475-621 crates/…/channel.rs• L697-729 crates/…/channel.rs• L721-834 crates/…/channel.rs• L764-795 crates/…/channel.rs• L831-845 crates/…/message.rs• L4-31 crates/…/message.rs• L34-69 crates/…/pending.rs• L25-43 crates/…/pending.rs• L78-123 crates/…/tests.rs• L142-244 crates/…/raw_and_listeners.rs• L6-88 crates/…/raw_and_listeners.rs• L91-231 crates/…/same_header.rs• L5-126

Channel observation

Channel observation is an optional diagnostic stream at the point where the channel owns report parsing and request correlation. It records the exact outgoing bytes sent after report normalization, valid incoming reports with their matched request when one exists, malformed incoming bytes, reports from another protocol on a shared HID node, and the final outcome of each request (crates/…/observation.rs• L90-135).

Each observation owns a bounded copy of the report, so a consumer can inspect wire data after the channel has reused its read buffer. Request IDs connect matched report observations to request outcomes. Unmatched and late valid HID++ reports have no request ID, while malformed reports and foreign reports use separate observation types. Writes that do not expect a response also have no request ID (crates/…/observation.rs• L16-57, crates/…/observation.rs• L90-127).

Observers run outside the channel's internal locks and can receive calls from concurrent request tasks and the reader thread. They must return promptly. The channel catches observer panics so diagnostics cannot stop message processing or channel shutdown, and consumers should use request IDs rather than callback order to join related events (crates/…/observation.rs• L137-167).

References: crates/…/observation.rs• L16-57 crates/…/observation.rs• L74-135 crates/…/observation.rs• L137-221 crates/…/tests.rs• L12-223

Protocol versions

HID++ 1.0 and HID++ 2.0 use the same HID report transport but address device behavior in different ways. HID++ 1.0 uses registers and sub-IDs. HID++ 2.0 uses a device index, a feature-table index, a function ID, and a software ID (crates/…/v10.rs• L10-29, crates/…/v20.rs• L14-32).

Version detection sends a HID++ 2.0 ping and interprets either a valid 2.0 response or the specific 1.0 error that signals an older device. The normal path applies a bounded request lifetime. An owned write-through path is available when a caller must finish the native write even if the caller stops waiting. This lets the higher layer reject HID++ 1.0 peripherals when it needs the HID++ 2.0 feature model (crates/…/protocol.rs• L45-121).

The two versions share channel error handling, but each protocol maps its own device errors into typed results. HID++ 1.0 can add an echoed sub-register value to response matching when one register serves many slots. HID++ 2.0 recognizes its shifted error frame and can attribute an error to a request from the header even when the response uses a different report width. Unknown wire values become unsupported-response errors instead of silently becoming a default value (crates/…/v10.rs• L107-156, crates/…/v10.rs• L224-286, crates/…/v20.rs• L69-96, crates/…/v20.rs• L184-230).

References: crates/…/protocol.rs• L13-43 crates/…/protocol.rs• L45-141 crates/…/v10.rs• L107-156 crates/…/v10.rs• L224-286 crates/…/v20.rs• L69-96 crates/…/v20.rs• L184-230

HID++ 1.0 registers

HID++ 1.0 peripherals expose support through fixed register addresses instead of a feature table. The public register layer asks the channel to read a known address and treats only the device's InvalidAddress response as proof that the register is absent. A sleeping, busy, or silent receiver does not prove that the register is unsupported (crates/…/register.rs• L1-11, crates/…/battery.rs• L29-45).

Battery support illustrates how this older model becomes typed data. The battery register API represents a coarse status register and a percentage charge register. Both layouts are reverse engineered rather than taken from a published Logitech specification, and both normalize their wire-specific charging values into discharging, recharging, or full (crates/…/battery.rs• L1-7, crates/…/battery.rs• L15-27, crates/…/battery.rs• L69-179).

The status form can report a coarse level without a usable level byte while charging. The percentage form rejects values above 100. Unknown level or charging encodings remain protocol errors, so a caller does not receive a false battery state (crates/…/battery.rs• L81-94, crates/…/battery.rs• L117-139).

References: crates/…/register.rs• L1-11 crates/…/battery.rs• L1-7 crates/…/battery.rs• L15-45 crates/…/battery.rs• L49-179

HID++ 2.0 device model

Device session

A HID++ 2.0 device session represents one peripheral at one device index on a channel. Session creation verifies the protocol version and installs the Root feature, which every HID++ 2.0 device provides (crates/…/device.rs• L19-40, crates/…/device.rs• L42-76).

The Root feature is the entry point for the device's feature map. It can ping the device and resolve a global feature ID to the device-local index, feature version, and feature flags (crates/…/root.rs• L9-18, crates/…/root.rs• L34-57). The global feature ID identifies a kind of device service. The local index is the address used in later messages.

References: crates/…/device.rs• L19-76 crates/…/root.rs• L34-75 crates/…/v20.rs• L14-32

Feature table

The feature table is the device's declaration of supported HID++ services. The session reads the table through the FeatureSet feature, records each feature's global ID, version, and flags, and creates a typed feature object when the registry knows how to support that version (crates/…/device.rs• L129-197, crates/…/feature_set.rs• L12-83).

The feature table is fixed for the connection. A repeated read of an entry can adopt an identical outstanding reply because no write can change the table. Each entry also gets a short deadline and several attempts. This allows a lossy direct Bluetooth link to lose a report without turning a partial walk into a false absence (crates/…/device.rs• L216-270, crates/…/feature_set.rs• L12-24).

The registry connects protocol IDs to human-readable names and to version-aware feature implementations. Current typed support spans device information and names, battery and charging, pointer and wheel behavior, DPI and report rates, host-platform state, control remapping, lighting, haptics, force-sensing buttons, touch input, lock-key state, headset services, onboard profiles, mouse-button monitoring, and G-key state. Gaming M-key and macro-record features are also known by ID and can be decoded as event streams, but they do not expose request operations. A feature may be known but have no local implementation. That distinction preserves discovery data without claiming support for operations the library cannot perform (crates/…/registry.rs• L65-112, crates/…/registry.rs• L257-275).

The feature table is also the main source for product capability derivation. Its entries describe what the device advertises. Higher layers can then add a small number of capability checks when a feature's table entry alone is not enough (crates/…/features.rs• L175-219).

References: crates/…/device.rs• L129-197 crates/…/device.rs• L216-270 crates/…/feature_set.rs• L12-83 crates/…/root.rs• L78-100 crates/…/registry.rs• L65-112 crates/…/registry.rs• L159-275

Feature endpoint

A feature endpoint represents one device-local feature address above the message channel. It centralizes HID++ 2.0 request framing for short and long calls, write-through calls, and no-response notifications. Feature code therefore exposes product-facing protocol actions instead of repeating device, feature, function, and software-ID handling (crates/…/feature.rs• L202-346).

Feature types expose product-facing protocol actions rather than raw byte arrays. The model covers identity and firmware data, battery readings, wheel and pointer controls, DPI, report rates, host selection, keyboard controls, gaming-key events, remapping, lighting, haptics, force thresholds, touch input, audio, lock-key state, onboard profile state, mouse-button reports, and other Logitech services listed in the feature registry (crates/…/feature.rs• L65-78, crates/…/registry.rs• L159-275).

Feature implementations keep wire values typed. Enumerated values and bit fields describe the device's state, and malformed or unknown values remain visible as protocol errors when the library cannot safely continue. Bit fields retain unknown bits when the protocol permits forward-compatible discovery (crates/…/feature.rs• L398-445, crates/…/thumbwheel.rs• L23-39, crates/…/thumbwheel.rs• L254-280).

References: crates/…/feature.rs• L65-78 crates/…/feature.rs• L202-346 crates/…/feature.rs• L398-445 crates/…/registry.rs• L159-275 crates/…/disable_keys.rs• L11-109 crates/…/force_sensing_button.rs• L17-169

Gaming keyboard controls

Gaming keyboard features expose dedicated G keys, M keys, and the macro-record key as live input state above raw HID reports. The G-key feature can also transfer the whole G-key row from onboard actions to software, while the M-key and macro-record features only report state and do not change keyboard ownership (crates/…/gaming_g_keys.rs• L1-15, crates/…/gaming_m_keys.rs• L1-8, crates/…/macro_record.rs• L1-7).

Each event describes the complete current state. G keys use a bit mask for held keys, M keys use a bit mask for the M1–M3 row, and the macro-record event uses a Boolean held value. Unknown mask bits remain available so a longer or newer keyboard does not lose state (crates/…/gaming_g_keys.rs• L35-70, crates/…/gaming_m_keys.rs• L15-41, crates/…/macro_record.rs• L14-26).

The protocol documentation names these gaming features without publishing function tables. Their event meanings therefore come from reverse-engineered device behavior. The registry gives G keys a typed feature endpoint, while M keys and macro record remain known feature IDs with event decoders but no request-side feature object (crates/…/gaming_g_keys.rs• L1-15, crates/…/gaming_m_keys.rs• L1-8, crates/…/macro_record.rs• L1-7, crates/…/registry.rs• L257-260).

References: crates/…/gaming_g_keys.rs• L1-15 crates/…/gaming_g_keys.rs• L35-109 crates/…/gaming_m_keys.rs• L1-48 crates/…/macro_record.rs• L1-35 crates/…/registry.rs• L257-260

Sidetone control

Sidetone is the HID++ audio feature that controls the level and mute state of headset audio feedback. Feature 0x8300 is supported at version 0 by devices such as the G535 and G733, and it exposes these controls through the same typed endpoint model as other HID++ 2.0 services (crates/…/sidetone.rs• L1-11, crates/…/sidetone.rs• L35-41).

The feature represents the level as a documented value from 0 through 100 and represents mute state as per-channel bit masks. A level response above 100 is rejected as an unsupported response. A level write returns the value echoed by the device, which is the confirmation to use because a later read can briefly expose the old level on some headset paths (crates/…/sidetone.rs• L13-33, crates/…/sidetone.rs• L43-87).

Mute updates use a change mask and a desired-status mask. The change mask selects the channels to update, while the status mask gives the target mute state for those channels. This keeps unrelated channel states unchanged and lets callers read the complete status separately (crates/…/sidetone.rs• L25-33, crates/…/sidetone.rs• L67-79).

References: crates/…/sidetone.rs• L1-11 crates/…/sidetone.rs• L13-41 crates/…/sidetone.rs• L43-87 crates/…/tests.rs• L29-71

Device and host information

HID++ identity features describe the device beyond its product kind. Device Information reports transport support, model identifiers, unit identity, firmware entities, and optional serial-number support. Device Friendly Name provides the user-visible name in chunks, while the Dual Platform and Multi Platform features describe how the device selects host-operating-system behavior (crates/…/device_information.rs• L53-98, crates/…/device_information.rs• L101-149, crates/…/device_friendly_name.rs• L23-68, crates/…/multi_platform.rs• L75-92).

Device Type and Name provides the device's marketing type and name. The type is a typed protocol value. The name is read in transport-sized chunks and joined before UTF-8 decoding, so a character split across two replies remains valid (crates/…/device_type_and_name.rs• L20-72, crates/…/device_type_and_name.rs• L74-121). Device Friendly Name uses a length record and 15-byte chunks for the current and default names. Whole-name writes use the device's maximum length and stop at a UTF-8 character boundary (crates/…/device_friendly_name.rs• L23-70, crates/…/device_friendly_name.rs• L131-192).

The platform features represent both simple and detailed device behavior. Dual Platform exposes a choice between two platform groups. Multi Platform exposes capability flags, platform descriptors with operating-system and version ranges, host slots, automatic detection, and the source of the current selection. A platform-change event can preserve the host and platform even when its source value is not known. This lets higher layers present a capability model without treating one device's platform codes as a general operating-system enum (crates/…/dual_platform.rs• L27-99, crates/…/multi_platform.rs• L14-23, crates/…/multi_platform.rs• L83-203).

References: crates/…/device_information.rs• L45-98 crates/…/device_friendly_name.rs• L23-70 crates/…/device_friendly_name.rs• L131-216 crates/…/device_type_and_name.rs• L20-121 crates/…/dual_platform.rs• L27-99 crates/…/multi_platform.rs• L14-23 crates/…/multi_platform.rs• L83-203

Battery services

Battery services vary across Logitech device generations. Inventory prefers Unified Battery, then legacy Battery Status, then voltage-only Battery Voltage, and maps each protocol form into one shared battery model (crates/…/features.rs• L52-62, crates/…/features.rs• L119-146). The HID++ layer also exposes ADC measurement as a voltage-and-charging source for devices that advertise 0x1F20; it remains a voltage reading rather than a native percentage (crates/…/adc_measurement.rs• L1-19, crates/…/adc_measurement.rs• L68-85). Older HID++ 1.0 peripherals expose battery data through the register model described above rather than through this feature table (crates/…/battery.rs• L15-27).

The legacy battery feature reports a coarse discharge level and charging state. Battery Voltage reports a measured voltage with charging flags and a critical marker. Both features can identify an unsolicited status report so consumers can re-read current state instead of waiting for a poll (crates/…/battery_status.rs• L1-13, crates/…/battery_status.rs• L44-76, crates/…/battery_voltage.rs• L36-84).

References: crates/…/features.rs• L30-62 crates/…/features.rs• L119-146 crates/…/adc_measurement.rs• L1-19 crates/…/adc_measurement.rs• L68-85 crates/…/battery_status.rs• L1-13 crates/…/battery_voltage.rs• L36-84 crates/…/battery.rs• L15-27

Pointer and sensor controls

Pointer features expose a progression from one sensor and a flat DPI list to multi-sensor controls. Adjustable DPI supports the older list and current value model. Extended DPI adds independent X/Y values, lift-off distance, profiles, calibration, events, and supported DPI ranges. Report-rate features expose the rates available for a given connection rather than assuming that USB and wireless offer the same choices (crates/…/adjustable_dpi.rs• L16-70, crates/…/extended_dpi.rs• L46-107, crates/…/types.rs• L71-103, crates/…/extended_report_rate.rs• L8-114).

The extended report-rate service separates rates supported by a connection type from rates usable on the active connection. It represents wired USB and gaming wireless separately, and can set the active host-side rate. A rate-change broadcast is a signal to re-read the current rate rather than a replacement for the rate value (crates/…/extended_report_rate.rs• L30-40, crates/…/extended_report_rate.rs• L72-127).

The device returns the addressing context with many sensor responses. The typed layer checks that context before using the values. This prevents a reply for another sensor, direction, or page from becoming a valid product setting (crates/…/adjustable_dpi.rs• L22-46, crates/…/extended_dpi.rs• L78-132).

References: crates/…/adjustable_dpi.rs• L16-70 crates/…/extended_dpi.rs• L46-132 crates/…/types.rs• L71-103 crates/…/extended_report_rate.rs• L8-135

Force-sensing buttons

Force-sensing button support represents each force button as a device-reported control with its own index, capabilities, default threshold, and inclusive threshold range. The feature reads this metadata without changing device defaults, then permits a threshold write only when the device marks the button as changeable and the value is inside the reported range (crates/…/force_sensing_button.rs• L17-110, crates/…/force_sensing_button.rs• L112-169).

The wire layout is reverse-engineered rather than based on a public Logitech specification. Raw threshold units remain device-specific. Unknown capability bits are retained, but they do not grant write access. A successful write is an acknowledgement, so callers read the current threshold again when they need verified state (crates/…/force_sensing_button.rs• L1-6, crates/…/force_sensing_button.rs• L119-169).

References: crates/…/force_sensing_button.rs• L1-6 crates/…/force_sensing_button.rs• L17-110 crates/…/force_sensing_button.rs• L112-169 crates/…/tests.rs• L43-246

ADC measurement

ADC measurement is the HID++ service for devices that report battery voltage through feature 0x1F20. It gives higher layers a voltage reading and charging state for wireless headsets that do not expose the older battery features, but it does not provide a percentage (crates/…/adc_measurement.rs• L1-19).

The service represents two meaningful states. An unlinked device has no usable reading. A linked device provides a millivolt value and one of the known charging states: discharging, charging, or full. A device-level LogitechInternal response is also treated as unlinked because some dongles use that response while the headset is switched off (crates/…/adc_measurement.rs• L51-85).

The same payload can arrive as a reply to a read or as an unsolicited event when the reading or link changes. The protocol keeps the event signal separate from payload decoding, so a consumer that only needs to know that state changed can still receive the signal when the flags are not understood (crates/…/adc_measurement.rs• L37-49, crates/…/adc_measurement.rs• L87-120).

References: crates/…/adc_measurement.rs• L1-19 crates/…/adc_measurement.rs• L29-65 crates/…/adc_measurement.rs• L68-120

Pointer motion scaling

Pointer motion scaling is the HID++ service for a device-specific multiplier over pointer movement. Feature 0x2205 exposes a typed value in 8.8 fixed-point form, where 0x0100 means the normal 1× scale (crates/…/pointer_motion_scaling.rs• L1-21).

The service supports reading the current multiplier and requesting a new one. The device returns the value it applies, so callers can observe firmware clipping or other device-side adjustment. Zero is not a valid multiplier and becomes an unsupported response rather than a silent default (crates/…/pointer_motion_scaling.rs• L23-55, crates/…/pointer_motion_scaling.rs• L65-86).

References: crates/…/pointer_motion_scaling.rs• L1-21 crates/…/pointer_motion_scaling.rs• L23-55 crates/…/pointer_motion_scaling.rs• L57-86

Input and control remapping

Control features describe physical and virtual controls before they change device behavior. Reprogrammable Controls exposes control identity, grouping, reporting state, diversion, raw input, and control-related events. Persistent Remappable Action maps those controls to keyboard, mouse, consumer, power, or internal actions stored for a host slot (crates/…/reprog_controls.rs• L21-92, crates/…/reprog_controls.rs• L139-199, crates/…/persistent_remappable_action.rs• L1-7, crates/…/persistent_remappable_action.rs• L143-180).

Disable Keys provides a smaller control service for the fixed Caps Lock, Num Lock, Scroll Lock, Insert, and Windows keys. It reports both the set the device can disable and the set currently disabled. A write replaces the full set, so an empty set re-enables all supported keys. An unsolicited change report is treated as a signal to re-read the set rather than as a trusted second payload format (crates/…/disable_keys.rs• L1-5, crates/…/disable_keys.rs• L11-109).

These services separate temporary diversion from persistent remapping. When both are present, active diversion takes precedence over the persistent mapping. The distinction lets product code model live input events without losing the device's stored action configuration (crates/…/persistent_remappable_action.rs• L1-7, crates/…/reprog_controls.rs• L54-71).

References: crates/…/reprog_controls.rs• L21-92 crates/…/reprog_controls.rs• L139-199 crates/…/persistent_remappable_action.rs• L1-7 crates/…/persistent_remappable_action.rs• L102-180 crates/…/disable_keys.rs• L1-109

Onboard profiles

Onboard Profiles is the device service for profiles stored in a peripheral's own memory. It reports the memory and profile layout, exposes the temporary choice between onboard and host control, selects the current enabled profile, and reads profile memory without writing flash (crates/…/onboard_profiles.rs• L1-3, crates/…/onboard_profiles.rs• L36-67, crates/…/onboard_profiles.rs• L81-139).

Profile discovery starts with the user directory. If that directory is blank, the feature reads the factory directory instead. Directory entries preserve the device's profile index, memory sector, and enabled state. Profile names are available for supported profile formats and are decoded from the stored UTF-16 text; blank and firmware placeholder names are omitted (crates/…/onboard_profiles.rs• L141-185, crates/…/onboard_profiles.rs• L202-235).

The feature keeps mode and profile identity distinct. Host mode has no active onboard profile, while onboard mode selects a one-based enabled profile. Unknown mode values remain protocol errors, so product code does not apply an unsafe default (crates/…/onboard_profiles.rs• L92-125).

References: crates/…/onboard_profiles.rs• L1-3 crates/…/onboard_profiles.rs• L36-67 crates/…/onboard_profiles.rs• L81-139 crates/…/onboard_profiles.rs• L141-185 crates/…/onboard_profiles.rs• L202-235 crates/…/registry.rs• L267-268

Mouse button monitoring

Mouse Button Spy is a device service for reporting the buttons currently held and for describing the HID button mapping used in host mode. It reports a bounded set of up to 16 button slots, can start and stop reports, and reads or replaces the slot mapping (crates/…/mouse_button_spy.rs• L1-3, crates/…/mouse_button_spy.rs• L18-24, crates/…/mouse_button_spy.rs• L60-103).

The event payload is a 16-bit held-button mask in which bit n identifies slot n. Mapping values use 0 for no HID button and reject codes or lists outside the 16-slot limit. This keeps button monitoring and host mapping as separate views of the same device feature (crates/…/mouse_button_spy.rs• L32-58, crates/…/mouse_button_spy.rs• L105-121).

References: crates/…/mouse_button_spy.rs• L1-3 crates/…/mouse_button_spy.rs• L18-24 crates/…/mouse_button_spy.rs• L32-58 crates/…/mouse_button_spy.rs• L60-121 crates/…/registry.rs• L267-269

RGB effects

RGB effects is the modern lighting service for devices that expose feature 0x8071. It describes the device as LED clusters with supported effects, then exposes control over effect parameters, persistence, power modes, and stored settings (crates/…/rgb_effects.rs• L1-16, crates/…/rgb_effects.rs• L61-70).

The service separates discovery from control. Device, cluster, and effect information show what the hardware can do. Software must first claim control before it changes effects or power modes, and the service can report effect changes, user activity, and synchronization events to listeners (crates/…/rgb_effects.rs• L72-108, crates/…/rgb_effects.rs• L137-161, crates/…/rgb_effects.rs• L253-280).

RGB state includes volatile and non-volatile settings. The feature also supports power behavior and wider lighting payloads, so its operations use the same typed endpoint model while the channel preserves write order for control claims and effect changes (crates/…/rgb_effects.rs• L174-210, crates/…/rgb_effects.rs• L298-355).

HID++ also exposes older and specialized lighting models. Color LED Effects uses zones and effect-specific parameters. Per-Key Lighting stages zone changes and commits them as a frame. Illumination models brightness, color temperature, ambient-light state, and selectable levels. LED Control models simpler device LEDs, including a DPI indicator that software can claim and set. Backlight models brightness, color temperature, ambient-light modes, and predefined keyboard effects (crates/…/color_led_effects.rs• L1-10, crates/…/per_key_lighting.rs• L1-10, crates/…/illumination.rs• L1-10, crates/…/led_control.rs• L1-7, crates/…/backlight.rs• L139-223).

References: crates/…/rgb_effects.rs• L1-16 crates/…/rgb_effects.rs• L50-161 crates/…/rgb_effects.rs• L174-280 crates/…/color_led_effects.rs• L1-10 crates/…/per_key_lighting.rs• L1-10 crates/…/illumination.rs• L34-80 crates/…/types.rs• L14-105 crates/…/led_control.rs• L13-79 crates/…/backlight.rs• L139-223 crates/…/backlight.rs• L225-376 crates/…/tests.rs• L10-234

Illumination controls

Illumination is the typed service for a light with on/off state, brightness in lumens, and color temperature in kelvin. It reports the valid range and resolution for each control, and it supports either a linear level range or a non-linear list of levels (crates/…/illumination.rs• L64-182, crates/…/types.rs• L31-105).

Feature version and control flags determine whether a device has a dynamic brightness limit. The typed result distinguishes an unsupported query from a supported light with no active limit and a light with a non-zero limit. Illumination events report state changes, value changes, limit changes, and brightness clamping (crates/…/illumination.rs• L118-143, crates/…/types.rs• L64-78, crates/…/event.rs• L6-48).

Level writes preserve the device's whole configuration model. A reset or linear range uses one request, while a non-linear table is sent as ordered pages. A rejected page can leave earlier pages applied, so callers must treat a failed multi-page write as a partial device change (crates/…/illumination.rs• L210-243, crates/…/types.rs• L128-203).

References: crates/…/illumination.rs• L34-80 crates/…/illumination.rs• L83-182 crates/…/illumination.rs• L184-243 crates/…/types.rs• L14-105 crates/…/types.rs• L128-203 crates/…/event.rs• L6-48

LED control

LED Control is the simple service for devices that expose one or more software-controlled indicator LEDs. It first describes the LED count, kind, physical LED count, and supported states. Software can then take control from firmware and set an LED on or off (crates/…/led_control.rs• L13-27, crates/…/led_control.rs• L66-95, crates/…/led_control.rs• L107-148).

The service keeps LED capability discovery separate from LED ownership. A state write has an effect only while software owns control of the LEDs. This supports device features such as a DPI indicator without treating every LED as a general lighting effect system (crates/…/led_control.rs• L124-147).

References: crates/…/led_control.rs• L1-7 crates/…/led_control.rs• L13-95 crates/…/led_control.rs• L99-148

Lock-key state

Lock Key State is a keyboard service that reports the engaged state of Num Lock, Caps Lock, and Scroll Lock. It provides an initial state read and an unsolicited update when a lock state changes (crates/…/lock_key_state.rs• L1-16, crates/…/lock_key_state.rs• L25-49).

The state is a bit set rather than a closed enum. Known bits map to the three named keys, while unknown bits remain in the value so a newer keyboard does not make the whole state unreadable (crates/…/lock_key_state.rs• L40-65).

References: crates/…/lock_key_state.rs• L1-16 crates/…/lock_key_state.rs• L25-65

Backlight state

Backlight separates persistent configuration from current information. Its configuration describes enablement, active and supported options, level, effect, mode, and four fade durations. Its information describes the active status and effect plus out-of-box durations. A backlight information event signals that callers should re-read this state; a temporary effect does not replace the persistent configuration (crates/…/backlight.rs• L139-223, crates/…/backlight.rs• L225-285, crates/…/backlight.rs• L288-376).

References: crates/…/backlight.rs• L139-223 crates/…/backlight.rs• L225-285 crates/…/backlight.rs• L288-376

Feature events

Some features report state without a request. An emitting feature attaches a shared event source to the channel. The source filters reports for its device and feature address, separates device broadcasts from responses caused by another client, checks the minimum payload length for the event sub-ID, and decodes the result into a typed event (crates/…/feature.rs• L80-200, crates/…/feature.rs• L348-395).

The event path separates two kinds of external change. A device broadcast uses software ID 0. A nonzero response whose software ID this channel does not use can be a response to another client, so a feature may decode it when it must learn that another client changed device state. Reports matched to this channel's own requests, including its late replies, remain outside the event stream (crates/…/feature.rs• L128-140, crates/…/feature.rs• L348-395).

For example, the thumbwheel feature can read its information and status, switch between native and diverted reporting, and convert diverted status reports into rotation, touch, proximity, and tap events (crates/…/thumbwheel.rs• L41-87, crates/…/thumbwheel.rs• L187-251). RGB effects uses the same path for effect synchronization, user activity, and cluster changes (crates/…/rgb_effects.rs• L50-59, crates/…/tests.rs• L134-180). Battery, DPI, illumination, platform, backlight, report-rate, and lock-key features use broadcasts to signal state changes while their payloads remain subject to each feature's wire decoder (crates/…/battery_status.rs• L30-54, crates/…/extended_dpi.rs• L57-71, crates/…/dual_platform.rs• L62-71, crates/…/adc_measurement.rs• L37-49, crates/…/event.rs• L31-48, crates/…/backlight.rs• L260-285, crates/…/extended_report_rate.rs• L72-84, crates/…/lock_key_state.rs• L40-49). Mouse Button Spy uses the same broadcast path for held-button masks (crates/…/mouse_button_spy.rs• L28-58).

References: crates/…/feature.rs• L80-200 crates/…/feature.rs• L348-395 crates/…/thumbwheel.rs• L41-87 crates/…/thumbwheel.rs• L187-251 crates/…/rgb_effects.rs• L50-59 crates/…/battery_status.rs• L30-54 crates/…/extended_dpi.rs• L57-71 crates/…/dual_platform.rs• L62-71 crates/…/adc_measurement.rs• L37-49 crates/…/event.rs• L31-48 crates/…/backlight.rs• L260-285 crates/…/extended_report_rate.rs• L72-84 crates/…/lock_key_state.rs• L40-49 crates/…/mouse_button_spy.rs• L28-58

Device addressing

Wireless receiver path

A wireless receiver is a HID++ endpoint that controls paired devices and relays traffic to them. The library identifies supported Bolt and Unifying receivers from their USB vendor and product IDs, then uses HID++ 1.0 registers for receiver control (crates/…/receiver.rs• L1-38).

The receiver uses device index 0xff for its own register operations. A paired peripheral uses its receiver slot as the device index for HID++ 2.0 operations. Receiver events supply slot identity and link state, while the peripheral's own feature table supplies its detailed capabilities (crates/…/receiver.rs• L24-49, crates/…/bolt.rs• L177-242, crates/…/probe.rs• L75-125).

Bolt notifications also cover device discovery and pairing progress. Discovery details and names arrive as separate events that share a counter, while pairing events carry the device address and passkey state. The decoder keeps unknown device kinds as an unknown identity and drops only reports whose address, payload, or text cannot be trusted (crates/…/event.rs• L49-117, crates/…/event.rs• L162-274).

Bolt receiver metadata can also provide a paired device codename. The receiver reads the first name chunk and requests a short continuation only when the reported length needs it. It returns the usable first chunk when the continuation is missing or invalid, so a partial name does not hide the paired device (crates/…/bolt.rs• L254-317, crates/…/bolt.rs• L397-437).

Bolt and Unifying share the broad receiver role but do not share every wire encoding. Their notification flags, pairing metadata, and device-kind mappings remain separate. The shared notification flags retain bits owned by other host software. Unifying reads and updates only its wireless bit, skips identical writes, and enables wireless notifications before an arrival trigger can enumerate paired devices (crates/…/receiver.rs• L44-93, crates/…/bolt.rs• L148-184, crates/…/unifying.rs• L138-177).

References: crates/…/receiver.rs• L1-49 crates/…/receiver.rs• L72-101 crates/…/event.rs• L13-117 crates/…/event.rs• L162-353 crates/…/bolt.rs• L30-73 crates/…/bolt.rs• L102-244 crates/…/bolt.rs• L254-317 crates/…/unifying.rs• L44-89 crates/…/unifying.rs• L120-285 crates/…/probe.rs• L75-125

Direct device path

A direct device is a peripheral that exposes HID++ without a receiver slot. The inventory layer addresses it at HID++ device index 0xff, probes its own feature table, and uses the result to decide whether the node is a real configurable peripheral (crates/…/probe.rs• L411-485).

This path lets the same typed feature operations work over USB, Bluetooth, and Bluetooth Low Energy. Transport differences stay below the protocol layer: BLE-direct nodes may be long-report-only, while the HID++ channel still presents the same feature endpoint model above them (crates/…/transport.rs• L54-81, crates/…/transport.rs• L388-410).

The route layer selects a receiver channel or a direct channel before a product operation begins. As a result, callers can address a device route without carrying transport-specific message logic (crates/…/route.rs• L24-80).

References: crates/…/probe.rs• L411-519 crates/…/transport.rs• L54-81 crates/…/route.rs• L24-80

Address resolution flow

The protocol flow resolves a physical HID node into a channel, identifies the addressing mode, discovers the device's feature map, and exposes only the typed services that the device advertises. The diagram shows how receiver and direct paths join at the HID++ 2.0 device model.

flowchart TD
    A[Raw HID node] --> B[HID++ channel]
    B --> C{Receiver detected?}
    C -->|Bolt or Unifying| D[Receiver at index 0xff]
    D --> E[Paired device slot]
    C -->|No| F[Direct device at index 0xff]
    E --> G[HID++ 2.0 version check]
    F --> G
    G --> H[Root feature]
    H --> I[Feature table]
    I --> J[Typed feature services]
    J --> K[Product data and controls]

References: crates/…/route.rs• L24-80 crates/…/device.rs• L42-197 crates/…/probe.rs• L53-72

Capability derivation

Product capability model

Product capabilities are derived from the device's advertised feature IDs and from selected feature reads. The inventory layer converts protocol-specific results into shared device data such as battery state, model information, device kind, and controls available to the user (crates/…/features.rs• L30-50).

The feature table is the broad capability signal. Follow-up reads refine cases where presence does not prove support, such as wheel inversion, an older gesture-based thumbwheel, a haptic control panel, multi-sensor DPI, a force-sensing button's writable threshold, or a lighting control mode. A failed read is tracked as incomplete rather than treated as proof that the capability is absent (crates/…/features.rs• L284-334).

Battery support illustrates compatibility across device generations. Inventory prefers Unified Battery, then legacy Battery Status, then voltage-only Battery Voltage, and maps each protocol form into one shared battery model (crates/…/features.rs• L52-62, crates/…/features.rs• L119-146). The HID++ layer also exposes ADC measurement as a voltage-and-charging source for devices that advertise 0x1F20; it remains a voltage reading rather than a native percentage (crates/…/adc_measurement.rs• L1-19, crates/…/adc_measurement.rs• L68-85).

References: crates/…/features.rs• L30-50 crates/…/features.rs• L119-146 crates/…/features.rs• L284-334 crates/…/adc_measurement.rs• L1-19 crates/…/adc_measurement.rs• L68-85 crates/…/force_sensing_button.rs• L62-169

Device identity mapping

Device kind is an identity hint, not a capability check. HID++ exposes a device's own marketing type through feature 0x0005 (DeviceTypeAndName); that feature also supplies the marketing name in chunks. Receivers report a separate pairing-register kind. The inventory layer maps each source into the shared core vocabulary and prefers the device's own type when it is known (crates/…/features.rs• L148-172, crates/…/mappings.rs• L54-92, crates/…/device_type_and_name.rs• L20-72).

User-visible names have more than one source. Device Friendly Name is a writable name with a separate default name and a device-reported maximum. Device Type and Name is the device's marketing name. Both are read in chunks and joined before decoding, so a character split across replies does not become invalid text (crates/…/device_friendly_name.rs• L23-70, crates/…/device_friendly_name.rs• L131-192, crates/…/device_type_and_name.rs• L45-65).

These sources use different numeric vocabularies. Never move a raw kind integer between the Bolt register, the Unifying register, HID++ feature 0x0005, and the shared core model. Convert at the boundary, and use the feature table for decisions about controls and panels (.claude/…/hidpp.md• L12-15, crates/…/mappings.rs• L22-92).

References: crates/…/features.rs• L148-172 crates/…/mappings.rs• L22-92 crates/…/device_type_and_name.rs• L20-121 crates/…/device_friendly_name.rs• L23-70 crates/…/device_friendly_name.rs• L131-216 .claude/…/hidpp.md• L12-15

Product operation boundary

The OpenLogi HID layer turns a device route into an open HID++ device session, resolves a feature by its global ID, and invokes the typed feature API. This keeps product operations such as DPI, wheel mode, lighting, haptics, force thresholds, and diagnostics independent of whether the device is direct or paired (crates/…/write.rs• L69-103).

The product layer also translates HID++ errors into shared operation errors. This preserves a stable application-facing result while retaining the difference between an unsupported feature, a device-level failure, and a transport failure (crates/…/error.rs• L1-40).

References: crates/…/write.rs• L13-65 crates/…/write.rs• L69-103 crates/…/error.rs• L1-40

Change checklist

When these files or sections are changed, remember to consider these:

  • A new HID++ feature must align its protocol ID, supported version, registry entry, and product capability mapping. A mismatch can leave a feature visible in discovery but unavailable to operations.
  • Sidetone changes must preserve feature 0x8300 version 0, the inclusive 0..=100 level contract, the echoed level as write confirmation, and the separate change-mask and status-mask meanings for mute updates.
  • Device Information changes must preserve the link between reported feature version, transport and model identity, firmware entity count, and optional serial-number support.
  • Device and friendly-name changes must preserve the source distinction between marketing and user names, the reported chunk offsets, the maximum-length limit, and UTF-8-safe joining and truncation.
  • Multi-platform changes must keep capability flags, platform descriptor OS masks and version ranges, host-slot selection, and platform-source values distinct. A host-platform write does not confirm the applied state, so callers must read it back.
  • Battery feature changes must preserve the distinct meanings of percentage, voltage, charging state, critical state, and link state. A status broadcast should remain a signal to re-read rather than a second battery payload model.
  • HID++ 1.0 register changes must keep register presence detection limited to InvalidAddress and must preserve the separate meanings of coarse level, percentage, charging state, and an unavailable level.
  • DPI changes must preserve sensor and direction echoes, bounded range termination, and capability-dependent X/Y and lift-off parameters.
  • Force-sensing button changes must preserve the distinction between a button index and a control ID, raw threshold units and percentages, read-only capability, inclusive bounds, metadata validation, and acknowledgement versus read-back state.
  • Report-rate changes must keep connection-specific capabilities separate from the actual rates available on the current connection. The supported-rate mask comes from its defined payload byte, and a rate broadcast remains a signal to re-read.
  • Lighting changes must preserve the distinction between capability discovery, software control, volatile state, non-volatile state, and frame or effect commit. LED Control requires software ownership before a state write. Illumination effective-maximum reads require both the supported feature version and the dynamic-maximum capability.
  • A remapping change must preserve the relationship between temporary diversion and persistent action. Active diversion takes precedence when both features are present.
  • Onboard Profiles changes must preserve the one-based profile identity, user-directory fallback to the factory directory, supported name formats, and the read-only memory contract. This feature must not gain an implicit flash-write path.
  • Mouse Button Spy changes must preserve the 16-slot limit, the held-button mask byte order, 0 as the unmapped value, and the distinction between a button count, a slot mapping, and an event mask.
  • A feature-table retry may adopt an abandoned reply only when the table entry is immutable. Do not extend that shortcut to reads whose answer can change after a write.
  • A new feature event must preserve the distinction between a matched response, a device broadcast, and a response caused by another client. Its event sub-ID must be decoded only after the device, feature, and software-ID ownership checks.
  • A feature that must observe another client's response must opt into foreign-response decoding without also publishing this channel's own unmatched or late replies.
  • Lock-key and disable-key decoding must retain unknown bits. LED kind and state decoding must not turn an unsupported LED type into a known product function.
  • A new receiver or transport must update both channel discovery and route selection. Otherwise the HID node may be visible but never reach the correct receiver or direct-device branch.
  • Changes to software-ID allocation must preserve unique request correlation across simultaneous channels and keep ID 0 available for notifications. Channel shutdown must also return any leased ID only after its reader has stopped.
  • Raw report listener changes must preserve delivery of complete wire-framed reports before HID++ parsing. Listener removal during dispatch must not change the current report's snapshot, and guarded listeners must stop after their guard is dropped.
  • Raw report write changes must preserve exact bytes and the 1-to-4095-byte input bound. Invalid input must fail before transport I/O, and a parked transport must still respect the write timeout.

Important failure modes

TriggerConsequenceGuard
A raw node is not a supported HID++ collectionThe node cannot open as an HID++ channelTransport discovery filters by Logitech HID++ usage collections before channel creation (crates/…/transport.rs• L174-208).
A shared HID node emits a non-HID++ report IDThe channel drops the report without treating it as a broken HID++ exchangeReport IDs 0x10 and 0x11 are HID++; other IDs are classified as foreign traffic (crates/…/message.rs• L16-25, crates/…/channel.rs• L752-766).
A raw vendor report is needed but only a typed message listener is installedThe shared-node vendor event is invisible to the consumerRaw report listeners receive every wire-framed input before HID++ parsing (crates/…/channel.rs• L764-845).
A raw output report is empty or exceeds the channel's boundThe vendor operation is rejected before transport writeRaw writes require a length from 1 through 4095 bytes, and invalid input is checked before I/O (crates/…/channel.rs• L704-728, crates/…/raw_and_listeners.rs• L52-70).
The raw transport parks during an output writeThe operation could wait forever without a channel timeoutRaw writes race transport I/O against a bounded timeout (crates/…/channel.rs• L709-728, crates/…/raw_and_listeners.rs• L73-88).
A listener is removed while the current report is being dispatchedThat report can still reach the removed listener, while later reports must notDispatch uses a listener snapshot; removal applies to later reports (crates/…/channel.rs• L831-837, crates/…/raw_and_listeners.rs• L91-119).
A guarded raw listener's guard is dropped too earlyLater vendor reports are no longer observedKeep the guard alive for the required subscription lifetime (crates/…/channel.rs• L778-789, crates/…/raw_and_listeners.rs• L197-231).
A device answers only as HID++ 1.0HID++ 2.0 feature operations are not availableSession creation detects the version and returns an unsupported-protocol result (crates/…/device.rs• L42-79).
A HID++ 1.0 battery register returns a non-invalid-address error during presence detectionThe caller can report a false absence while the device is asleep or busyRegister support returns errors other than InvalidAddress instead of treating them as absence (crates/…/battery.rs• L29-45).
A HID++ 1.0 battery reply contains an unknown encoding or an impossible percentageProduct code receives no safe battery stateTyped register decoders reject unknown charging and level values and percentages above 100 (crates/…/battery.rs• L81-94, crates/…/battery.rs• L128-139).
Two same-header requests are sent before the first reply is resolvedA receiver can deliver one reply to the wrong requestThe channel serializes same-header requests and quarantines late replies (crates/…/channel.rs• L475-560, crates/…/pending.rs• L162-295, crates/…/same_header.rs• L5-126).
Two HID++ 1.0 sub-register reads share a register headerA reply for one receiver slot can satisfy another slot's readThe RAP matcher requires the echoed sub-register byte for sub-register reads (crates/…/v10.rs• L224-270, crates/…/v10.rs• L459-491).
A name chunk is decoded before later chunks are joinedA multi-byte UTF-8 character split across replies is rejectedName features join all bytes before UTF-8 decoding (crates/…/device_type_and_name.rs• L45-65, crates/…/device_friendly_name.rs• L49-70).
A friendly-name write sends every chunk at the same offset or cuts a characterLater chunks overwrite earlier text or the stored name becomes invalid UTF-8The feature advances by 15-byte offsets and truncates at a character boundary (crates/…/device_friendly_name.rs• L154-184).
A profile directory is blank and the caller does not check the factory directoryFactory profiles appear to be absentDirectory discovery falls back from the user sector to the ROM sector (crates/…/onboard_profiles.rs• L141-167).
An onboard profile mode or memory name format is unknownProduct code can show or select a false profile stateUnknown mode values fail, and unsupported profile formats return no name (crates/…/onboard_profiles.rs• L92-100, crates/…/onboard_profiles.rs• L170-185).
A mouse button count or mapping contains more than 16 slots or an invalid codeThe device state cannot be represented safelyThe feature rejects counts, mappings, and button codes above the 16-slot limit (crates/…/mouse_button_spy.rs• L60-71, crates/…/mouse_button_spy.rs• L105-121).
A feature ID is present but its version has no registered implementationDiscovery can report the feature, but no typed operation is attachedRegistry lookup is version-aware and leaves unknown implementations unregistered (crates/…/registry.rs• L90-112, crates/…/device.rs• L185-194).
A response contains an unknown configuration enum or malformed feature payloadThe operation fails instead of returning an unsafe stateWire enums and feature decoders return unsupported-response errors. Diverted thumbwheel events preserve unknown rotation statuses so they do not lose the user's rotation input (crates/…/v20.rs• L205-214, crates/…/thumbwheel.rs• L23-39, crates/…/thumbwheel.rs• L254-280).
A sidetone response contains a level above 100Product code can expose a value outside the documented headset rangeThe typed sidetone decoder returns UnsupportedResponse instead of accepting the value (crates/…/sidetone.rs• L43-49, crates/…/sidetone.rs• L83-87).
A sidetone write is followed immediately by a read and the read is treated as confirmationProduct state can briefly show the previous headset levelThe write result is the device's echoed level and must be used as confirmation (crates/…/sidetone.rs• L51-65).
A force-button metadata reply is short, has an invalid range, or places the default outside that rangeThe library could bind a button to unsafe or false limitsMetadata requires a long reply and rejects invalid ranges or defaults as an unsupported response (crates/…/force_sensing_button.rs• L68-95).
A force-button write uses an unnamed capability bit or an out-of-range thresholdThe device could reject the write or receive a value outside its supported limitsOnly CHANGEABLE grants write access, and the cached inclusive range is checked before any report is sent (crates/…/force_sensing_button.rs• L149-168).
A force-button write acknowledgement is treated as current stateProduct state can disagree with firmware clipping or rejectionThe acknowledgement is not read-back; callers use get_button_config to verify the applied threshold (crates/…/force_sensing_button.rs• L149-152, crates/…/tests.rs• L140-164).
A response contains a report-rate mask in the wrong payload byteThe device appears to support the wrong report ratesExtended report-rate parsing reads the defined mask byte and keeps byte zero out of the rate list (crates/…/extended_report_rate.rs• L130-135).
A device returns information for another sensor, direction, page, zone, or clusterA valid response can be applied to the wrong product settingSensor and lighting feature decoders verify echoed addressing before accepting the payload (crates/…/extended_dpi.rs• L84-132, crates/…/color_led_effects.rs• L52-66, crates/…/rgb_effects.rs• L72-93).
A device advertises a newer feature version or unknown bitKnown capabilities can be hidden or an unknown value can become a false defaultVersion-aware registry entries preserve discovery, and bit fields retain unknown bits where the protocol permits them (crates/…/registry.rs• L70-109, crates/…/haptic_feedback.rs• L12-24, crates/…/multi_platform.rs• L26-56, crates/…/lock_key_state.rs• L51-65).
A short backlight or illumination configuration reply is accepted as completeFade durations, ranges, or level counts can be lost or written back as zeroBacklight and illumination reads require the long payloads that contain their full state (crates/…/backlight.rs• L288-310, crates/…/backlight.rs• L351-369, crates/…/illumination.rs• L184-232).
An RGB effect or power write runs before software control is claimedThe device rejects the operation or leaves the requested state unchangedRGB control calls expose the required control step and preserve ordered writes (crates/…/rgb_effects.rs• L137-161, crates/…/rgb_effects.rs• L253-280).
An LED state is written while firmware still owns the LEDThe indicator does not show the requested stateLED Control requires software control before the state write (crates/…/led_control.rs• L124-147).
A dynamic illumination maximum is queried on an older or fixed-range lightThe device can reject an unsupported function or the caller can report a false limitThe typed wrapper checks feature version and HAS_DYNAMIC_MAXIMUM, and distinguishes unsupported, no-limit, and limited results (crates/…/illumination.rs• L118-143, crates/…/types.rs• L64-78).
A non-linear illumination table write fails after one or more pagesEarlier levels remain applied while later levels do notThe write model sends ordered pages and callers treat a failed multi-page write as partial (crates/…/illumination.rs• L235-243, crates/…/types.rs• L159-203).
A persistent remap is treated as the active input while a control is divertedProduct input and stored action state disagreeReprogrammable Controls takes precedence over Persistent Remappable Action for diverted controls (crates/…/persistent_remappable_action.rs• L1-7).
A feature-table or follow-up capability read times outA complete capability set may be mistaken for a negative resultPer-entry retries and incomplete-probe tracking preserve known-good data (crates/…/device.rs• L216-270, crates/…/features.rs• L284-289).
A response caused by another client is discarded as an ordinary unmatched replyA feature can miss a state change made by software such as Logi Options+Event sources compare response software IDs with the channel's owned IDs and allow a feature to decode foreign responses when needed (crates/…/channel.rs• L204-227, crates/…/feature.rs• L128-200).
An observer blocks while the reader or request task calls itIncoming reports and request progress can stallObservers run synchronously, so they must return promptly and hand slow work to their own worker (crates/…/observation.rs• L137-147).
An observer panics during report or request deliveryWithout isolation, diagnostics could stop channel processing or reader shutdownObserver calls are wrapped so a panic is ignored and the reader thread continues (crates/…/observation.rs• L163-167).
A receiver-reported kind is copied as a raw integer into another modelThe device can receive the wrong identity or UI treatmentEach receiver and HID++ source maps into the shared kind type at its boundary (crates/…/mappings.rs• L22-92).
A platform-change report has an unknown source valueThe host and platform change can be lost even though the selected platform is usableMulti Platform keeps the source optional and retains the host and platform fields (crates/…/multi_platform.rs• L171-203).
A host-platform write is treated as proof that the device applied the selectionProduct state can show a platform that the device did not selectThe write path does not confirm the selection; callers re-read the host platform (crates/…/multi_platform.rs• L234-265).
A Bolt codename reports a continuation but its second chunk is lost, has the wrong chunk marker, or contains invalid textThe paired device can lose its full name or expose unsafe textThe receiver keeps the first chunk, checks the continuation marker, clamps the reported length, joins bytes before UTF-8 decoding, and uses a short optional-read timeout (crates/…/bolt.rs• L281-317, crates/…/bolt.rs• L404-437).

Key files

FileWhy to read it
crates/…/Cargo.tomlDefines the hard-fork package, its workspace integration, and its public hidpp library target. It also shows the dependencies used for typed protocol features, diagnostics, and feature wiring.
crates/…/lib.rsDefines the public protocol crate surface and the top-level distinction between raw HID transport and Logitech HID++ operations.
crates/…/channel.rsDefines request correlation, channel-owned software IDs, foreign-response classification, late-reply handling, notification delivery, raw report listeners, raw output writes, write ordering, time limits, report-width handling, and channel shutdown.
crates/…/message.rsDefines the short and long HID++ report forms and separates HID++ report IDs from foreign traffic on shared HID nodes.
crates/…/raw.rsDefines the raw HID contract and the report-descriptor check that identifies short and long HID++ report support.
crates/…/pending.rsShows how active requests and replies from abandoned requests remain separate during correlation.
crates/…/tests.rsShows the request-key lifecycle, stale-reply quarantine, adoption of immutable reads, and ordering guarantees.
crates/…/observation.rsDefines the optional wire and request-lifecycle view used to trace channel behavior without changing protocol handling.
crates/…/raw_and_listeners.rsDemonstrates exact raw-report writes, invalid-input and timeout guards, complete delivery of foreign reports, and listener lifetime behavior.
crates/…/same_header.rsDemonstrates why same-header requests wait and why late replies cannot answer a later request.
crates/…/send.rsDemonstrates report widening, time limits, write-through ordering, cancellation, and late-response handling.
crates/…/protocol.rsShows how the library distinguishes HID++ 1.0 from HID++ 2.0 and supports bounded and write-through version probes.
crates/…/v10.rsExplains the register model used by receivers, typed register errors, and the response matching needed for receiver slots.
crates/…/v20.rsExplains feature addressing, shifted error responses, long-report handling, and typed HID++ 2.0 errors.
crates/…/register.rsDefines the public HID++ 1.0 register surface and its fixed-address model.
crates/…/battery.rsDefines HID++ 1.0 battery-register presence checks, coarse and percentage readings, charging-state conversion, and malformed-response handling.
crates/…/device.rsShows how a device session discovers and installs supported features, including retry behavior for lost feature-table replies.
crates/…/root.rsDefines the root entry point and feature-ID-to-index resolution.
crates/…/feature_set.rsShows how the feature table is enumerated and retried as stable device data.
crates/…/registry.rsConnects HID++ feature IDs and versions to typed support across identity, battery, sensors, host state, controls, lighting, haptics, force-sensing buttons, onboard profiles, mouse-button monitoring, and input services.
crates/…/feature.rsDefines feature endpoints, shared request framing, and the broadcast and foreign-response event paths.
crates/…/device_type_and_name.rsDefines the typed marketing device type and chunked marketing-name model.
crates/…/device_friendly_name.rsDefines current and default friendly names, chunked reads, UTF-8-safe writes, and reset behavior.
crates/…/sidetone.rsDefines the version-zero Sidetone feature, its level range, echoed writes, and per-channel mute masks.
crates/…/tests.rsVerifies registry support and the Sidetone read, write, validation, and wire-report contracts.
crates/…/onboard_profiles.rsDefines onboard profile metadata, host and onboard modes, profile directory discovery, profile names, and read-only profile memory access.
crates/…/mouse_button_spy.rsDefines held-button events, button-count limits, and host-mode button mapping.
crates/…/disable_keys.rsDefines fixed-key disable capability, whole-set updates, and state-change signaling.
crates/…/force_sensing_button.rsDefines force-button metadata, capability-bound threshold writes, and read-back state.
crates/…/tests.rsShows the wire-level force-button contract and guards against invalid metadata, unsafe writes, and false acknowledgement state.
crates/…/device_information.rsDefines transport, model, firmware, unit, and serial-number information.
crates/…/extended_dpi.rsDefines multi-sensor DPI capabilities, ranges, calibration, and state events.
crates/…/extended_report_rate.rsDefines connection-specific report-rate capability lists, active rate reads, rate changes, and rate-change broadcasts.
crates/…/dual_platform.rsDefines the two-platform selection model and its state event.
crates/…/multi_platform.rsDefines host slots, platform descriptors, operating-system masks, and selection sources.
crates/…/battery_status.rsDefines the legacy percentage-and-charge-state battery model and status broadcast.
crates/…/battery_voltage.rsDefines the voltage-only battery model and charging flags used by gaming devices.
crates/…/adc_measurement.rsDefines the voltage-and-charging model for HID++ feature 0x1F20 and its link-change signal.
crates/…/pointer_motion_scaling.rsDefines the 8.8 pointer multiplier and read/write behavior for feature 0x2205.
crates/…/reprog_controls.rsDefines control discovery, temporary diversion, remapping state, and control events.
crates/…/persistent_remappable_action.rsDefines stored control actions and their relationship to temporary diversion.
crates/…/rgb_effects.rsIllustrates modern lighting capability discovery, control ownership, persistence, power modes, and RGB events.
crates/…/color_led_effects.rsDefines the older zone-based RGB effect model.
crates/…/per_key_lighting.rsDefines staged per-zone lighting updates and frame commits.
crates/…/illumination.rsDefines on/off light state, brightness and color-temperature controls, dynamic brightness limits, and level writes.
crates/…/led_control.rsDefines LED discovery, software ownership, and simple on/off indicator control.
crates/…/lock_key_state.rsDefines keyboard lock-key state reads and broadcasts while retaining unknown bits.
crates/…/backlight.rsDefines persistent backlight configuration, current information, and backlight events.
crates/…/thumbwheel.rsIllustrates typed feature state, diverted input events, and capability flags.
crates/…/receiver.rsDefines receiver detection, notification flags, and the receiver abstraction.
crates/…/bolt.rsShows the Bolt receiver's pairing, discovery, notification, paired-device metadata, and device-event model.
crates/…/event.rsShows how Bolt connection, discovery, and pairing notifications become safe typed events.
crates/…/unifying.rsShows the distinct Unifying notification, pairing, and wire-mapping model.
crates/…/probe.rsConnects receiver slots and direct devices to inventory records.
crates/…/features.rsDerives shared identity, battery, and capability data from HID++.
crates/…/mappings.rsDefines safe conversions from protocol vocabularies to core types.
crates/…/write.rsShows how product operations resolve routes and typed HID++ features.
crates/…/transport.rsShows how platform HID collections become raw channels and how long-only links work.