OpenLogi

0x8090 · modeStatus

Read or write a device's operating mode — toggling between performance and endurance via a bitmask-controlled status register, with hardware and software switch capability discovery.

Switches a device between performance and endurance operating modes. getModeStatus (function 0) reads the current ModeStatus (primary and secondary status bytes); setModeStatus (function 1) writes them back using an explicit changed-bit mask so callers update only the bits they intend to touch. The convenience wrapper set_performance_mode drives the single PERFORMANCE flag directly without requiring the caller to manage the mask. getDeviceConfig (function 2) reports which switch mechanisms the device exposes.

  • ModeStatus — the struct returned by getModeStatus, containing status0: ModeStatus0 (primary flags) and status1: u8 (secondary byte, reserved in v1 but preserved for callers).
  • ModeStatus0::PERFORMANCE — set = performance mode; unset = endurance mode.
  • ModeStatusCapabilities::HARDWARE_SWITCH — a physical switch on the device can change the mode bit.
  • ModeStatusCapabilities::SOFTWARE_SWITCH — software may change the mode bit.
  • ModeStatusChange — pairs desired values (status0, status1) with changed-bit masks (changed_mask0, changed_mask1); only masked bits are written.

Spec: Logitech HID++ 2.0 — modeStatus. Used by: Typed wrapper in openlogi-hidpp.

Function reference

The ModeStatusFeature wrapper (0x8090) exposes:

Methods

FunctionHID++ fnSignatureReturns
get_mode_status0()ModeStatus
set_mode_status1(change: ModeStatusChange)()
set_performance_mode1(enabled: bool)()
get_device_config2()ModeStatusCapabilities

All methods are async and return Result<…, Hidpp20Error>.

Types

ModeStatus

Current mode-status bytes returned by get_mode_status.

FieldTypeDescription
status0ModeStatus0Primary status bits.
status1u8Secondary status byte, reserved by v1 but preserved for callers.

ModeStatusChange

A mode-status update request passed to set_mode_status.

FieldTypeDescription
status0ModeStatus0Desired primary status bits.
status1u8Desired secondary status byte.
changed_mask0ModeStatus0Primary changed-bit mask.
changed_mask1u8Secondary changed-bit mask.

ModeStatus0

The first mode-status byte.

FlagBit/ValueDescription
PERFORMANCEbit 0Performance mode. When unset, the device is in endurance mode.

ModeStatusCapabilities

Capabilities reported by ModeStatus.

FlagBit/ValueDescription
HARDWARE_SWITCHbit 0A hardware switch can change the mode bit.
SOFTWARE_SWITCHbit 1Software can change the mode bit.

Wire format

Getter requests carry a 3-byte zero payload; set_mode_status uses a 16-byte long payload. Responses are decoded from the extended 16-byte payload returned by each call.

get_mode_status (fn 0)

Request: [0x00, 0x00, 0x00] (no parameters)

Response (byte → field):

ByteFieldNotes
0status0ModeStatus0 bitflags — bit 0 = PERFORMANCE
1status1Secondary status byte (reserved in v1)
2–15Unused

set_mode_status (fn 1)

Request (16-byte long payload):

ByteFieldNotes
0status0ModeStatus0::bits() — desired primary flags
1status1Desired secondary byte
2changed_mask0ModeStatus0::bits() — which primary bits to write
3changed_mask1Which secondary bits to write
4–15Zero

Response: no bytes consumed (only error status checked).

set_performance_mode (fn 1)

Convenience wrapper. Sends set_mode_status with status0 = PERFORMANCE (or empty) and changed_mask0 = PERFORMANCE, status1 = 0, changed_mask1 = 0. Wire layout is identical to set_mode_status above.

get_device_config (fn 2)

Request: [0x00, 0x00, 0x00] (no parameters)

Response (byte → field):

ByteFieldNotes
0capabilities high byteBig-endian u16 — bits 8–15 (none defined)
1capabilities low bytebit 0 = HARDWARE_SWITCH, bit 1 = SOFTWARE_SWITCH
2–15Unused

Usage (Rust)

use hidpp::{device::Device, feature::mode_status::ModeStatusFeature};

// device: &mut Device, already created via Device::new(channel, index)
device.enumerate_features().await?;
if let Some(feat) = device.get_feature::<ModeStatusFeature>() {
    // Read current mode
    let status = feat.get_mode_status().await?;
    println!("performance mode: {}", status.status0.contains(hidpp::feature::mode_status::ModeStatus0::PERFORMANCE));

    // Switch to performance mode
    feat.set_performance_mode(true).await?;

    // Check which switch mechanisms the device exposes
    let caps = feat.get_device_config().await?;
    println!("hw switch: {}, sw switch: {}",
        caps.contains(hidpp::feature::mode_status::ModeStatusCapabilities::HARDWARE_SWITCH),
        caps.contains(hidpp::feature::mode_status::ModeStatusCapabilities::SOFTWARE_SWITCH));
}

On this page