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<Self>
pub fn device_route_for(inv: &DeviceInventory, slot: u8) -> Option<Self>
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 moreSource§impl Debug for DeviceRoute
impl Debug for DeviceRoute
Source§impl<'de> Deserialize<'de> for DeviceRoute
impl<'de> Deserialize<'de> for DeviceRoute
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for DeviceRoute
impl Display for DeviceRoute
impl Eq for DeviceRoute
Source§impl PartialEq for DeviceRoute
impl PartialEq for DeviceRoute
Source§impl Serialize for DeviceRoute
impl Serialize for DeviceRoute
impl StructuralPartialEq for DeviceRoute
Auto Trait Implementations§
impl Freeze for DeviceRoute
impl RefUnwindSafe for DeviceRoute
impl Send for DeviceRoute
impl Sync for DeviceRoute
impl Unpin for DeviceRoute
impl UnsafeUnpin for DeviceRoute
impl UnwindSafe for DeviceRoute
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.