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 bygetModeStatus, containingstatus0: ModeStatus0(primary flags) andstatus1: 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
| Function | HID++ fn | Signature | Returns |
|---|---|---|---|
get_mode_status | 0 | () | ModeStatus |
set_mode_status | 1 | (change: ModeStatusChange) | () |
set_performance_mode | 1 | (enabled: bool) | () |
get_device_config | 2 | () | ModeStatusCapabilities |
All methods are async and return Result<…, Hidpp20Error>.
Types
ModeStatus
Current mode-status bytes returned by get_mode_status.
| Field | Type | Description |
|---|---|---|
status0 | ModeStatus0 | Primary status bits. |
status1 | u8 | Secondary status byte, reserved by v1 but preserved for callers. |
ModeStatusChange
A mode-status update request passed to set_mode_status.
| Field | Type | Description |
|---|---|---|
status0 | ModeStatus0 | Desired primary status bits. |
status1 | u8 | Desired secondary status byte. |
changed_mask0 | ModeStatus0 | Primary changed-bit mask. |
changed_mask1 | u8 | Secondary changed-bit mask. |
ModeStatus0
The first mode-status byte.
| Flag | Bit/Value | Description |
|---|---|---|
PERFORMANCE | bit 0 | Performance mode. When unset, the device is in endurance mode. |
ModeStatusCapabilities
Capabilities reported by ModeStatus.
| Flag | Bit/Value | Description |
|---|---|---|
HARDWARE_SWITCH | bit 0 | A hardware switch can change the mode bit. |
SOFTWARE_SWITCH | bit 1 | Software 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):
| Byte | Field | Notes |
|---|---|---|
| 0 | status0 | ModeStatus0 bitflags — bit 0 = PERFORMANCE |
| 1 | status1 | Secondary status byte (reserved in v1) |
| 2–15 | — | Unused |
set_mode_status (fn 1)
Request (16-byte long payload):
| Byte | Field | Notes |
|---|---|---|
| 0 | status0 | ModeStatus0::bits() — desired primary flags |
| 1 | status1 | Desired secondary byte |
| 2 | changed_mask0 | ModeStatus0::bits() — which primary bits to write |
| 3 | changed_mask1 | Which secondary bits to write |
| 4–15 | — | Zero |
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):
| Byte | Field | Notes |
|---|---|---|
| 0 | capabilities high byte | Big-endian u16 — bits 8–15 (none defined) |
| 1 | capabilities low byte | bit 0 = HARDWARE_SWITCH, bit 1 = SOFTWARE_SWITCH |
| 2–15 | — | Unused |
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));
}