功能(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
| Function | HID++ fn | Signature | Returns |
|---|---|---|---|
get_battery_level_status | 0 | () | 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
| Field | Type | Description |
|---|---|---|
discharge_level | u8 | Current charge as a percentage (0–100). Firmware reports it in coarse steps, not as a continuous value. |
next_level | u8 | The next lower discharge step the firmware will report — a granularity hint, unused for display. |
status | LegacyBatteryStatus | The current charging status. |
LegacyBatteryStatus
| Variant | Value | Description |
|---|---|---|
Discharging | 0 | Battery is discharging. |
Recharging | 1 | Battery is recharging. |
AlmostFull | 2 | Charging and nearly full. |
Full | 3 | Charge complete. |
SlowRecharge | 4 | Recharging below optimal speed. |
InvalidBattery | 5 | The battery type is invalid. |
ThermalError | 6 | The battery subsystem reported a thermal error. |
Other | 7 | Other 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):
| Byte | Field | Notes |
|---|---|---|
| 0 | discharge_level | percentage, in coarse firmware steps |
| 1 | next_level | next lower step the firmware will report |
| 2 | status | LegacyBatteryStatus 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);
}