Skip to main content

Module write

Module write 

Source
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.
EasySwitchHosts
The Easy-Switch channels of a multi-host device, read from 0x1815.
EasySwitchSlot
One Easy-Switch channel of a multi-host device.
FeatureEntry
Snapshot of one HID++ feature exposed by a device: protocol ID + version. Returned by dump_features for diagnostics.
FirmwareEntityInfo
Firmware fields for one entity whose record the device answered and this parser decoded.
HostOs
The operating system a keyboard’s platform descriptors are matched against.
HostOsInfo
The OS and version the computer on a slot recorded in the device.
LightingWrite
One complete solid-colour transaction, including RGB ownership rollback.
LitraDescriptor
A known Litra raw-HID identity and its static product metadata.
OsMask
Operating systems covered by a platform descriptor.
OsVersion
An OS version as a platform descriptor bounds it: a major version and a revision.
PointerScaling
A pointer-motion multiplier in 8.8 fixed point (0x0100 is 1×).
ReportRate
How often a device sends movement reports, in whole hertz.
ReportRateInfo
A device’s report rate and the rates it lets software choose.
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.
RgbControlLease
0x8071 software control a lighting write left asserted, with the control and event flags the device reported before that claim.
ScrollWheelMode
Current HID++ 0x2121 wheel reporting mode.

Enums§

FirmwareEntity
One firmware entity a device reports through HID++ 0x0003 function 1. Returned by dump_firmware_entities so a device report can name the exact firmware it is running.
HapticWaveform
A haptic waveform ID accepted by playWaveform.
HidppFeatureErrorKind
HID++ feature error kind in a serializable wire-safe form.
HidppOperation
HID++ operation being performed when a device write/read failed.
HostConnection
How a host slot reaches its computer.
HostOsKind
An operating system a host slot can record.
LightCommand
A semantic command accepted by the standalone-light layer.
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.
LitraModel
A supported Litra product model.
OsLayoutOutcome
What keep_os_layout_on did.
ScrollReportingTarget
Destination for vertical wheel movement reports.
ScrollResolution
Vertical wheel reporting resolution for HID++ 0x2121 HiResWheel.
WriteError
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.
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 route reports — used by openlogi diag features to confirm which DPI / SmartShift / etc. feature IDs a given peripheral actually exposes (e.g. whether a mouse speaks 0x2201 AdjustableDpi, 0x2202 ExtendedAdjustableDpi, or both — write::dpi drives either).
dump_firmware_entities
Read every firmware entity the device on route reports.
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.
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: the enable flag set. Returns true when a repair write was needed.
find_litra
Finds a Litra descriptor by its complete writable raw-HID identity.
get_backlight
Read the current backlight state of the keyboard on route.
get_backlight_on
Read the current backlight state on an already-open SharedChannel.
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_dpi_info_on
Read current DPI and supported values on an already-open SharedChannel.
get_easy_switch_hosts
Read the Easy-Switch slots of the device on route.
get_easy_switch_hosts_on
Read the Easy-Switch slots on an already-open SharedChannel.
get_fn_lock
Read the keyboard’s Fn-lock state on route.
get_fn_lock_on
Read the keyboard’s Fn-lock state on an already-open SharedChannel.
get_pointer_scaling
Read the pointer-motion scaling of the device route reaches.
get_report_rate_info
Read the report rate and the rates the device lists on route.
get_report_rate_info_on
Read the report rate and the rates the device lists 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.
keep_os_layout_on
Keep the keyboard’s current Easy-Switch slot on host’s platform, on an already-open SharedChannel. A slot already on it is left alone; a write the keyboard does not read back surfaces as WriteError::UnsupportedResponse.
litra_model_for_route
Resolve a model only when the complete raw-HID route matches a registered Litra interface.
matches_litra
Whether an HID descriptor identifies a supported Litra interface.
play_haptic
Play a waveform immediately by route. A waveform the device does not advertise fails with WriteError::HapticWaveformUnsupported, and a play while the device reports a non-zero haptic status with WriteError::HapticsUnavailable, before anything is sent.
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 0x1004 fields, the legacy 0x1000 discharge_level/next_level/status, or the 0x1F20 ADC voltage and charging state. For openlogi 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).
release_rgb_control
Hand lease back to the firmware on shared, as a long-lived host does when it leaves. available must reject retired publications and suspended host I/O. Bounded by the same five-second read deadline as a write.
rename_easy_switch_host
Name the computer on Easy-Switch slot of the device on route and return the slots the device reports afterwards. The checks of EasySwitchHosts::name_for run against a fresh read before anything is written; a name the device does not read back fails with WriteError::HostNameNotApplied.
rename_easy_switch_host_on
rename_easy_switch_host on an already-open SharedChannel.
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 on route: true = the F-row sends F1–F12 without holding Fn. Returns the state the keyboard reports after the write; a keyboard that did not take it surfaces as WriteError::UnsupportedResponse.
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 device to a solid (r, g, b) colour, choosing the HID++ path automatically: 0x8070 → 0x8071 → 0x8081 → 0x8080.
set_keyboard_color_on
Set a solid keyboard colour on an already-open SharedChannel, using LightingMethod::Auto.
set_keyboard_color_with
set_keyboard_color with an explicit LightingMethod. Unsupported discovery permits fallback; failures after RGB ownership is claimed do not. Like LightingWrite::apply_on, this future must be driven to completion.
set_keyboard_color_with_on
Set a solid keyboard colour on an already-open SharedChannel with an explicit lighting method. Drive to completion; see LightingWrite::apply_on.
set_pointer_scaling
Write a pointer-motion scaling and return the value the device reports afterwards.
set_report_rate
Set the report rate on route and return what the device reports afterwards. A rate the device does not list fails with WriteError::ReportRateUnsupported before anything is written.
set_report_rate_on
Set the report rate on an already-open SharedChannel — the fast path that skips enumeration and channel setup.
set_scroll_inversion
Write the device’s native vertical-scroll inversion flag while preserving its current resolution. Enabling inversion selects native HID reporting; disabling it preserves the current reporting target so an unrelated host-side consumer does not lose diverted wheel events.
set_scroll_inversion_on
Write scroll inversion on an already-open SharedChannel, with the same reporting-target behavior as set_scroll_inversion.
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 current SmartShiftStatus and 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.
update_backlight
Apply one BacklightChange to the keyboard on route, and return the read-back state.
update_backlight_on
update_backlight on an already-open SharedChannel.