pub enum DeviceRoute {
Bolt {
receiver_uid: String,
slot: u8,
},
Unifying {
receiver_uid: String,
slot: u8,
},
Direct {
vendor_id: u16,
product_id: u16,
},
RawHid {
vendor_id: u16,
product_id: u16,
usage_page: u16,
usage_id: u16,
identity: String,
},
}Expand description
How to reach a controllable HID++ device.
Crosses the agent↔GUI IPC (every per-device RPC takes one), so variant and
field order are wire format — changes require a PROTOCOL_VERSION bump
(guarded by openlogi-ipc/tests/wire_format.rs).
Variants§
Bolt
Paired to a Logi Bolt receiver. receiver_uid disambiguates multiple
plugged-in receivers; slot is the device’s pairing slot (1..=6).
Fields
Unifying
Paired to a Logi Unifying receiver. Same addressing structure as Bolt (receiver channel + pairing slot) but the receiver speaks HID++ 1.0.
Fields
Direct
Attached straight to the host over USB cable or Bluetooth, addressed at the HID++ self-index. Re-found by matching the HID node’s vendor/product id — two identical mice on one host are indistinguishable here, so the first match wins (acceptable for v0).
Fields
RawHid
Standalone raw-HID device, such as a Litra light. The identity is an opaque transport-generated value used to disambiguate duplicate HID nodes; this route must never be passed to HID++ channel code.
Implementations§
Source§impl DeviceRoute
impl DeviceRoute
Whether two receiver routes use the same physical HID transport. Direct routes cannot prove identity because they carry only VID/PID.
Sourcepub fn device_index(&self) -> u8
pub fn device_index(&self) -> u8
The HID++ device index features are addressed at for this route: the pairing slot for a Bolt device, the self-index for a direct one.
Sourcepub fn device_route_for(inv: &DeviceInventory, slot: u8) -> Option<DeviceRoute>
pub fn device_route_for(inv: &DeviceInventory, slot: u8) -> Option<DeviceRoute>
Build the route that reaches a paired device from a receiver inventory.
Picks DeviceRoute::Unifying or DeviceRoute::Bolt based on the
receiver’s product ID via speaks_unifying_protocol (Unifying proper
plus protocol-compatible Lightspeed receivers). Any receiver that does
not speak the Unifying protocol — including future Bolt variants whose
PID isn’t yet in BOLT_PIDS — defaults to DeviceRoute::Bolt so
writes keep working rather than silently dropping.
DeviceRoute::Direct is used for directly-attached devices
(slot == DIRECT_DEVICE_INDEX with no receiver UID). Returns None
when the receiver UID is unknown (writes are skipped, not mis-routed).
Trait Implementations§
Source§impl Clone for DeviceRoute
impl Clone for DeviceRoute
Source§fn clone(&self) -> DeviceRoute
fn clone(&self) -> DeviceRoute
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more