OpenLogi
功能(Features)

0x1000 · batteryStatus

旧版电量功能——以粗略的放电等级加充电状态呈现,供从不暴露 0x1004 统一电池功能的老设备使用。

旧版电量功能:以放电等级充电状态的形式上报设备电量。它早于整合后的 0x1004 unifiedBattery,MX Master 2S 这类较老的鼠标只暴露 0x1000,从不暴露 0x1004

当统一电池功能缺席时,OpenLogi 的清单探测会回退到该功能——与 SmartShift 在 0x2111 / 0x2110 之间「先增强、后旧版」的模式一致——因此老鼠标在设备轮播与 openlogi list 中依然能显示电量。

规格: Logitech HID++ 2.0 —— x1000 batteryStatus用于: 旧设备的电量百分比 / 充电状态。

Function reference

The BatteryStatusFeature wrapper (0x1000) exposes:

Methods

FunctionHID++ fnSignatureReturns
get_battery_level_status0()LegacyBatteryInfo

The method is async and returns Result<…, Hidpp20Error>. The optional getBatteryCapability (function 1) and the broadcast event are not implemented — neither is needed to display a charge reading.

Types

LegacyBatteryInfo

FieldTypeDescription
discharge_levelu8Current charge as a percentage (0100). Firmware reports it in coarse steps, not as a continuous value.
next_levelu8The next lower discharge step the firmware will report — a granularity hint, unused for display.
statusLegacyBatteryStatusThe current charging status.

LegacyBatteryStatus

VariantValueDescription
Discharging0Battery is discharging.
Recharging1Battery is recharging.
AlmostFull2Charging and nearly full.
Full3Charge complete.
SlowRecharge4Recharging below optimal speed.
InvalidBattery5The battery type is invalid.
ThermalError6The battery subsystem reported a thermal error.
Other7Other charging error. Kept explicit so a device reporting it surfaces as unknown instead of failing the parse and making the battery indicator vanish.

Wire format

get_battery_level_status (fn 0)

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

Response (byte → field):

ByteFieldNotes
0discharge_levelpercentage, in coarse firmware steps
1next_levelnext lower step the firmware will report
2statusLegacyBatteryStatus enum value (0 = Discharging … 7 = Other)

An unrecognised status byte fails as Hidpp20Error::UnsupportedResponse rather than being guessed at.

Usage (Rust)

use hidpp::{device::Device, feature::battery_status::BatteryStatusFeature};

// device: &mut Device, already created via Device::new(channel, index)
device.enumerate_features().await?;

if let Some(feat) = device.get_feature::<BatteryStatusFeature>() {
    let info = feat.get_battery_level_status().await?;
    println!("{}% — {:?}", info.discharge_level, info.status);
}

另见: 0x1004 unifiedBattery0x1001 batteryVoltage

本页目录