Expand description
HID++ reads and writes per feature — DPI, SmartShift, wheel modes, lighting, backlight, and diagnostics.
Each entry point takes a DeviceRoute and resolves it to an open channel
through open_route_channel, so the same call works whether the device is
behind a Bolt receiver or attached directly (USB cable / Bluetooth). Each
route-addressed call re-enumerates and re-opens, while the corresponding
_on entry points reuse a crate::SharedChannel already owned by
inventory or a standalone capture session.
Structs§
- Dpi
- A sensor resolution that fits HID++’s unsigned 16-bit DPI field.
- DpiCapabilities
- Supported DPI values reported by a device’s HID++ AdjustableDpi feature.
- DpiInfo
- Current DPI plus the supported values reported by the device.
- Feature
Entry - Snapshot of one HID++ feature exposed by a device: protocol ID +
version. Returned by
dump_featuresfor diagnostics. - Firmware
Entity Info - Firmware fields for one entity whose record the device answered and this parser decoded.
- Reprog
Control Entry - Snapshot of one HID++
0x1b04reprogrammable control. Returned bydump_reprog_controlsfor diagnostics so new device controls can be identified before OpenLogi maps them to a first-class button. - Scroll
Wheel Mode - Current HID++
0x2121wheel reporting mode.
Enums§
- Firmware
Entity - One firmware entity a device reports through HID++
0x0003function 1. Returned bydump_firmware_entitiesso a device report can name the exact firmware it is running. - Haptic
Waveform - A haptic waveform ID accepted by
playWaveform. - Hidpp
Feature Error Kind - HID++ feature error kind in a serializable wire-safe form.
- Hidpp
Operation - HID++ operation being performed when a device write/read failed.
- Light
Command - A semantic command accepted by the standalone-light layer.
- Lighting
Method - Which HID++ lighting path drives a solid keyboard colour.
Autois what the GUI/agent use; the explicit variants exist for thediagA/B test. - Litra
Model - A supported Litra product family variant.
- Scroll
Reporting Target - Destination for vertical wheel movement reports.
- Scroll
Resolution - Vertical wheel reporting resolution for HID++
0x2121 HiResWheel. - Write
Error - Error returned by HID++ read/write operations.
Constants§
- LITRA_
BEAM_ PRODUCT_ ID - Litra Beam product ID.
- LITRA_
GLOW_ PRODUCT_ ID - Litra Glow product ID.
Functions§
- apply_
litra - Apply a semantic Litra command through a raw HID route.
- clear_
haptic_ feature_ cache - Drop the cached haptic feature handle (and with it the
Arc<HidppChannel>it pins). MUST be called whenever route resolution fails: the inventory enumerator only reopens a retired node once every clone of its channel has dropped (Arc::strong_count == 1), and a stale cache entry otherwise deadlocks recovery — the node can’t reopen because the cache pins the old channel, and the cache is never invalidated because route lookups fail before any haptic I/O touches it. - commands_
for_ light_ settings - Expand protocol-neutral saved settings into only the controls advertised by a standalone light. Unsupported controls are omitted rather than sent speculatively, which keeps power-only and brightness-only drivers usable.
- dump_
features - Enumerate every HID++ feature the device on
routereports — used byopenlogi diag featuresto confirm which DPI / SmartShift / etc. feature IDs a given peripheral actually exposes (e.g. whether a mouse speaks0x2201 AdjustableDpi,0x2202 ExtendedAdjustableDpi, or both —write::dpidrives either). - dump_
firmware_ entities - Read every firmware entity the device on
routereports. - dump_
reprog_ controls - Enumerate the device’s HID++
0x1b04reprogrammable controls. This is a diagnostics-only probe used to discover controls for newly released devices. For example, MX Master 4 has both a Gesture Button and a separate Haptic Sense Panel in the thumb area; this probe lets us identify the panel’s CID and capabilities before wiring it into the capture/remapping model. - encode_
litra_ command - Encode a semantic command into the exact fixed-width Litra report.
- ensure_
haptics_ armed_ on - Ensure the firmware haptic engine is armed: enabled, with a non-zero
intensity. Returns
truewhen a repair write was needed. - get_
backlight - Read the current backlight state of the keyboard on
route. - get_dpi
- Read the device’s current DPI on sensor 0 — companion to
set_dpi. Used byopenlogi diag dpiand any future Settings → Diagnostics surface that wants to display the current value without writing. - get_
dpi_ info - Read the current DPI and the supported DPI values for sensor 0 in one route/channel session.
- get_
dpi_ info_ on - Read current DPI and supported values on an already-open
SharedChannel. - get_
scroll_ wheel_ mode - Read the current vertical wheel reporting mode.
- get_
scroll_ wheel_ mode_ on - Read the current wheel mode on an already-open
SharedChannel. - get_
smartshift_ status - Read the device’s current SmartShift mode + sensitivity — companion to
toggle_smartshift. - get_
smartshift_ status_ on - Read SmartShift mode and sensitivity on an already-open
SharedChannel. - matches_
litra - Whether an HID descriptor identifies a supported Litra interface.
- play_
haptic - Play a waveform immediately by route.
- play_
haptic_ on - Play a waveform immediately on an open capture channel.
- read_
battery_ raw - Diagnostic read of the device’s raw battery report — the unified
0x1004fields, or the legacy0x1000discharge_level/next_level/status. Foropenlogi diag battery: surfaces exactly what the firmware reports so a claim like “MX2S shows 0% while charging” can be confirmed against the wire instead of guessed (the GUI only ever shows the mapped value). - set_
backlight_ enabled - Enable or disable the backlight on
route, and return the read-back state. - set_dpi
- Set sensor 0’s DPI for the device addressed by
route. - set_
dpi_ on - Write DPI on an already-open
SharedChannel— the fast path that skips enumeration and channel setup. - set_
fn_ lock - Write the keyboard’s Fn-lock state:
true= F-row sends F1–F12 directly. - set_
fn_ lock_ on - Write keyboard Fn-lock on an already-open
SharedChannel— the fast path that skips enumeration and channel setup. - set_
keyboard_ color - Set a keyboard to a solid
(r, g, b)colour, choosing the HID++ path automatically: the0x8070effect engine (which overrides the onboard profile) when present, else the0x8080per-key stream.FeatureUnsupportedwhen the device exposes neither. - set_
keyboard_ color_ on - Set a solid keyboard colour on an already-open
SharedChannel, usingLightingMethod::Auto. - set_
keyboard_ color_ with set_keyboard_colorwith an explicitLightingMethod.Autotries0x8070first and falls back to0x8080only when the effect engine is absent (a missing-0x8070FeatureUnsupported); any other error propagates.- set_
keyboard_ color_ with_ on - Set a solid keyboard colour on an already-open
SharedChannelwith an explicit lighting method. - set_
scroll_ inversion - Write the device’s native vertical-scroll inversion flag while preserving its current resolution.
- set_
scroll_ inversion_ on - Write native scroll inversion on an already-open
SharedChannel. - set_
scroll_ resolution - Set only the wheel resolution while preserving the current inversion flag. Reporting is always normalized to native HID.
- set_
scroll_ resolution_ on - Set only the wheel resolution on an already-open
SharedChannel. - set_
scroll_ wheel_ mode - Set wheel resolution and native inversion together in one HID++ write.
- set_
scroll_ wheel_ mode_ on - Set wheel resolution and inversion on an already-open
SharedChannel. - set_
smartshift - Write a full SmartShift configuration to
route. The values are volatile device state and should be re-applied after reconnect. Callers that mean to change one field should read the currentSmartShiftStatusand update it. - set_
smartshift_ on - Write a full SmartShift configuration on an already-open
SharedChannel— the fast path that skips enumeration and channel setup. - set_
smartshift_ sensitivity - Set the SmartShift auto-disengage sensitivity on
route, preserving the current mode. Returns the read-back status after the write so the caller can display and verify it. - toggle_
smartshift - Toggle SmartShift mode (free ↔ ratchet) on
route. Reads the current mode first, then writes the opposite — keeps current sensitivity. Returns the new mode written. - toggle_
smartshift_ on - Toggle SmartShift on an already-open
SharedChannel.