0x1D4B · wirelessDeviceStatus
接收设备重连广播,让 OpenLogi 重新装备捕获控件并重新应用易失设置。
wirelessDeviceStatus 是用于无线设备的纯事件 feature。OpenLogi 将已接受的广播视为重连信号,然后重新装备捕获会话,并安排重新应用配置。
**规格:**没有公开的 Logitech 规格。线格式来自 Logi Options+ 2.8(静态分析)。**交叉核对:**G HUB(静态分析)、Solaar。**用于:**OpenLogi inventory 和 capture session。
函数参考
WirelessDeviceStatusFeature 实现 feature version 0。它不发送 HID++ 请求。事件源绑定一个设备和 feature-table index,listen 为已解码的广播创建接收器。
方法
| 函数 | HID++ fn | 签名 | 返回值 |
|---|---|---|---|
listen | event | (&self) | async_channel::Receiver<WirelessDeviceStatusEvent> |
WirelessDeviceStatusEvent::decode | event | (function_id: u8, payload: &[u8; 16]) | Option<WirelessDeviceStatusEvent> |
listen 来自 EmittingFeature。如果 function_id 不为 0,decode 返回 None。
类型
WirelessDeviceStatusBroadcast
| 字段 | 类型 | 说明 |
|---|---|---|
status | WirelessDeviceStatus | 设备上报的状态。 |
request | WirelessDeviceStatusRequest | 设备请求的主机操作。 |
reason | WirelessDeviceStatusReason | 广播的原因。 |
WirelessDeviceStatus
| 变体 | 值 | 说明 |
|---|---|---|
Unknown | 0x00 | 未知无线设备状态。 |
Reconnection | 0x01 | 设备正在重连。 |
Other(u8) | 其他值 | 未建模的原始值。 |
WirelessDeviceStatusRequest
| 变体 | 值 | 说明 |
|---|---|---|
NoRequest | 0x00 | 不请求主机操作。 |
SoftwareReconfigurationNeeded | 0x01 | 主机必须重新配置设备。 |
Other(u8) | 其他值 | 未建模的原始值。 |
WirelessDeviceStatusReason
| 变体 | 值 | 说明 |
|---|---|---|
Unknown | 0x00 | 未知广播原因。 |
PowerSwitchActivated | 0x01 | 电源开关操作导致广播。 |
Other(u8) | 其他值 | 未建模的原始值。 |
事件
| 变体 | 载荷 | 说明 |
|---|---|---|
WirelessDeviceStatusEvent::StatusBroadcast | WirelessDeviceStatusBroadcast | 已解码的 function-0 状态广播。 |
线格式
设备发送未经请求的状态广播。OpenLogi 不为这个 feature 发送请求。它的 decoder 接收 16 字节扩展载荷,读取字节 0 到 2,并忽略其余字节。
StatusBroadcast(事件,fn 0)
| 字节 | 字段 | 类型 | 值 | 备注 |
|---|---|---|---|---|
| 0 | status | WirelessDeviceStatus | 0x00 = Unknown;0x01 = Reconnection | 其他值变为 Other(u8)。 |
| 1 | request | WirelessDeviceStatusRequest | 0x00 = NoRequest;0x01 = SoftwareReconfigurationNeeded | 其他值变为 Other(u8)。 |
| 2 | reason | WirelessDeviceStatusReason | 0x00 = Unknown;0x01 = PowerSwitchActivated | 其他值变为 Other(u8)。 |
| 3~15 | 未建模的尾部 | — | 含义未确定 | OpenLogi 忽略这些字节。 |
OpenLogi 的用法
Inventory 在枚举 0x1d4b 时记录 feature-table index。只有 software ID 为 0、feature index 匹配且 WirelessDeviceStatusEvent::decode 接受 function 0 时,Inventory 才接受事件。事件被接受后,Inventory 会清除缓存的锁定键状态,并请求重新协调。
Agent 将产生的 device-wake 事件视为重新配置信号。即使下一个 inventory snapshot 从未看到设备离线,Agent 也会在这个 snapshot 上安排重新应用配置。
Capture session 会在设置期间查询这个 feature。如果 feature 存在,session 会保留 listener。每个已解码的广播都会重置捕获输入状态,等待 re-arm settle delay;如果 I/O 仍被允许,session 会重新装备。session 不会按 status、request 或 reason 分支。
这个 feature 不拥有可写状态。它没有 read-modify-write 操作、read-back 检查或状态恢复。丢弃 feature 会移除受保护的 channel listener。
未确认的细节
OpenLogi 和 Solaar 只接受 function 0。Options+ 和 Linux HID++ driver 将 0x1d4b feature index 上的任意报告视为重连信号。没有 capture 或 field report 确定非零 function 的布局,因此 OpenLogi 保留 function-0 gate。
现有证据没有为载荷字节 3 到 15 指定含义。OpenLogi 忽略这些字节。
Rust 用法
use hidpp::{
device::Device,
feature::{
EmittingFeature,
wireless_device_status::{WirelessDeviceStatusEvent, WirelessDeviceStatusFeature},
},
};
// `device` is `&mut Device`, created with `Device::new`.
device.enumerate_features().await?;
if let Some(feature) = device.get_feature::<WirelessDeviceStatusFeature>() {
let events = feature.listen();
while let Ok(WirelessDeviceStatusEvent::StatusBroadcast(status)) = events.recv().await {
println!("{status:?}");
}
}