0x0000 · root
The HID++ 2.0 entry point — map a feature ID to its session index and verify the link with a ping.
The entry point of every HID++ 2.0 device. root maps a 16-bit feature ID
to the feature index the device uses for that feature in the current session,
and reports the HID++ protocol version.
A client calls getFeature(featureId) first, then addresses every other feature
by the index it returns. root itself is always at index 0.
Spec: Logitech HID++ 2.0 — x0000 root. Used by: all device access.
Function reference
The RootFeature wrapper (0x0000, always bound to feature index 0) exposes:
Methods
| Function | HID++ fn | Signature | Returns |
|---|---|---|---|
get_feature | 0 | (id: u16) | Option<FeatureInformation> |
ping | 1 | (data: u8) | u8 |
All methods are async and return Result<…, Hidpp20Error>. get_feature resolves to None when the device does not support the requested feature ID; ping echoes data back when the link is alive.
Types
FeatureInformation
Information about a feature, returned by get_feature.
| Field | Type | Description |
|---|---|---|
index | u8 | The feature's index in the device's feature table, used to address its functions. |
typ | FeatureType | The feature's type flags. |
version | u8 | Latest supported version of the feature (0 on root v0 devices). |
FeatureType
Feature classification flags decoded from the type byte.
| Field | Type | Description |
|---|---|---|
obsolete | bool | Feature replaced by a newer one, kept so older software still finds it (bit 7). |
hidden | bool | SW-hidden feature; configuration software should ignore it (bit 6). |
engineering | bool | Hidden feature disabled for user software; internal testing / manufacturing (bit 5). |
manufacturing_deactivatable | bool | Manufacturing feature that can be permanently deactivated (bit 4; added in v2). |
compliance_deactivatable | bool | Compliance feature that can be permanently deactivated (bit 3; added in v2). |
Wire format
Both functions use a 3-byte short-report request payload. Responses are read from the extended payload (up to 16 bytes) returned by the device.
get_feature (fn 0)
Request: [ id_hi, id_lo, 0x00 ]
- Byte 0: high byte of the 16-bit feature ID (
(id >> 8) as u8) - Byte 1: low byte of the 16-bit feature ID (
id as u8) - Byte 2: reserved, always
0x00
Response (byte → field):
| Byte | Field | Notes |
|---|---|---|
| 0 | index | Feature index in the device table. 0 means the feature is unsupported (returns None). |
| 1 | type byte → FeatureType | Bit 7 = obsolete, bit 6 = hidden, bit 5 = engineering, bit 4 = manufacturing_deactivatable, bit 3 = compliance_deactivatable. |
| 2 | version | Latest supported feature version; 0 on root v0 devices. |
ping (fn 1)
Request: [ 0x00, 0x00, data ]
- Bytes 0–1: reserved, always
0x00 - Byte 2: arbitrary ping byte chosen by the caller
Response (byte → field):
| Byte | Field | Notes |
|---|---|---|
| 2 | echoed data | The device echoes the ping byte at the same offset. Bytes 0–1 also carry the HID++ protocol version but are not exposed by this wrapper. |
Usage (Rust)
use hidpp::{device::Device, feature::root::RootFeature};
// mut device: Device, obtained via Device::new(channel, index).await?
// RootFeature is registered automatically; no enumerate_features() needed.
let feat = device.root(); // returns Arc<RootFeature>
// Look up a feature by its 16-bit ID (e.g. 0x1000 = battery unified).
if let Some(info) = feat.get_feature(0x1000).await? {
println!("feature 0x1000 → index {}, version {}", info.index, info.version);
}
// Verify the link is alive; the device echoes the byte back.
let echo = feat.ping(0x42).await?;
assert_eq!(echo, 0x42);