0x8060 · adjustableReportRate
旧版 HID 报告率控制——枚举设备支持的 1 ms 至 8 ms 轮询间隔,并读写当前活动间隔。
旧版 adjustableReportRate 功能控制设备向主机发送 HID 报告的频率,以毫秒为单位。get_report_rate_list(function 0)返回一个 ReportRateList 位字段,编码设备支持的所有间隔;get_report_rate(function 1)读取当前活动间隔;set_report_rate(function 2)写入新的间隔——设备会以 InvalidArgument 拒绝不支持的值。
ReportRateList—— 每个支持的间隔对应一个比特位:MS_1至MS_8(1 ms–8 ms)。某比特位被置位表示该设备支持对应的间隔。
规格: Logitech HID++ 2.0 —— adjustableReportRate。用于:
openlogi-hidpp中的类型化封装。
Function reference
The ReportRateFeature wrapper (0x8060) exposes:
Methods
| Function | HID++ fn | Signature | Returns |
|---|---|---|---|
get_report_rate_list | 0 | () | ReportRateList |
get_report_rate | 1 | () | u8 |
set_report_rate | 2 | (report_rate_ms: u8) | () |
All methods are async and return Result<…, Hidpp20Error>.
Types
ReportRateList
Report-rate values supported by a 0x8060 device, encoded as milliseconds.
| Flag | Bit/Value | Description |
|---|---|---|
MS_1 | 1 << 0 | 1 ms report interval. |
MS_2 | 1 << 1 | 2 ms report interval. |
MS_3 | 1 << 2 | 3 ms report interval. |
MS_4 | 1 << 3 | 4 ms report interval. |
MS_5 | 1 << 4 | 5 ms report interval. |
MS_6 | 1 << 5 | 6 ms report interval. |
MS_7 | 1 << 6 | 7 ms report interval. |
MS_8 | 1 << 7 | 8 ms report interval. |
Wire format
All three functions use a 3-byte request payload and return a 16-byte long response; only the first byte of the response payload carries meaningful data for the two getters.
get_report_rate_list (fn 0)
Request: [0x00, 0x00, 0x00] (no parameters)
Response (byte → field):
| Byte | Field | Notes |
|---|---|---|
| 0 | ReportRateList bitfield | Each bit corresponds to a supported interval: bit 0 = 1 ms, bit 1 = 2 ms, …, bit 7 = 8 ms. |
get_report_rate (fn 1)
Request: [0x00, 0x00, 0x00] (no parameters)
Response (byte → field):
| Byte | Field | Notes |
|---|---|---|
| 0 | report_rate_ms: u8 | Currently active report interval in milliseconds. |
set_report_rate (fn 2)
Request: [report_rate_ms, 0x00, 0x00]
| Byte | Field | Notes |
|---|---|---|
| 0 | report_rate_ms: u8 | Desired report interval in milliseconds. Must be a value advertised by get_report_rate_list; the device returns InvalidArgument otherwise. |
Response: no meaningful payload bytes.
Usage (Rust)
use hidpp::{device::Device, feature::report_rate::ReportRateFeature};
// mut device: Device, already created via Device::new(channel, index)
device.enumerate_features().await?;
if let Some(feat) = device.get_feature::<ReportRateFeature>() {
// Query which intervals this device supports.
let supported = feat.get_report_rate_list().await?;
println!("Supported intervals: {:?}", supported);
// Read the current active interval.
let current_ms = feat.get_report_rate().await?;
println!("Current report rate: {} ms", current_ms);
// Switch to 1 ms (1000 Hz) if the device advertises it.
use hidpp::feature::report_rate::ReportRateList;
if supported.contains(ReportRateList::MS_1) {
feat.set_report_rate(1).await?;
}
}