Skip to main content

Module write

Module write 

Source
Expand description

HID++ writes back to the device — DPI, SmartShift, lighting, 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 call re-enumerates and re-opens — fine at the frequency this is invoked (once per slider release) — unless a SharedChannel from the capture session is reused.

Structs§

DpiCapabilities
Supported DPI values reported by a device’s HID++ AdjustableDpi feature.
DpiInfo
Current DPI plus the supported values reported by the device.
FeatureEntry
Snapshot of one HID++ feature exposed by a device: protocol ID + version. Returned by dump_features for diagnostics.
ReprogControlEntry
Snapshot of one HID++ 0x1b04 reprogrammable control. Returned by dump_reprog_controls for diagnostics so new device controls can be identified before OpenLogi maps them to a first-class button.
SharedChannel
An open HID++ channel to a device, shared so DPI / SmartShift writes can reuse the capture session’s connection instead of re-enumerating and opening a fresh channel each time (which costs ~100ms+).

Enums§

HidppFeatureErrorKind
HID++ feature error kind in a serializable wire-safe form.
HidppOperation
HID++ operation being performed when a device write/read failed.
LightingMethod
Which HID++ lighting path drives a solid keyboard colour. Auto is what the GUI/agent use; the explicit variants exist for the diag A/B test.
WriteError
Error returned by HID++ read/write operations.

Functions§

dump_features
Enumerate every HID++ feature the device on route reports — used by openlogi diag features to confirm which DPI / SmartShift / etc. feature IDs a given peripheral actually exposes (e.g. some mice use 0x2202 ExtendedAdjustableDpi instead of 0x2201 AdjustableDpi).
dump_reprog_controls
Enumerate the device’s HID++ 0x1b04 reprogrammable 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.
get_dpi
Read the device’s current DPI on sensor 0 — companion to set_dpi. Used by openlogi diag dpi and 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_smartshift_status
Read the device’s current SmartShift mode + sensitivity — companion to toggle_smartshift.
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_keyboard_color
Set a keyboard to a solid (r, g, b) colour, choosing the HID++ path automatically: the 0x8070 effect engine (which overrides the onboard profile) when present, else the 0x8080 per-key stream. FeatureUnsupported when the device exposes neither.
set_keyboard_color_with
set_keyboard_color with an explicit LightingMethod. Auto tries 0x8070 first and falls back to 0x8080 only when the effect engine is absent (a missing-0x8070 FeatureUnsupported); any other error propagates.
set_smartshift
Write a full SmartShift configuration — wheel mode, auto-disengage threshold, and tunable torque — to route. These values are volatile device state and should be re-applied after reconnect. Callers that mean to change only one field should read the rest via get_smartshift_status first and pass them back unchanged. A 0 auto-disengage threshold or tunable torque is the firmware’s “do not change” sentinel, not a real value to apply. On a Legacy (0x2110) device the tunable_torque field is ignored.
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.