pub enum DeviceRoute {
Bolt {
receiver_uid: String,
slot: u8,
},
Unifying {
receiver_uid: String,
slot: u8,
},
Direct {
vendor_id: u16,
product_id: u16,
},
}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-agent-core/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).
Unifying
Paired to a Logi Unifying receiver. Same addressing structure as Bolt (receiver channel + pairing slot) but the receiver speaks HID++ 1.0.
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).
Implementations§
Source§impl DeviceRoute
impl DeviceRoute
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 using the canonical UNIFYING_PIDS / BOLT_PIDS
lists. Any receiver PID not in UNIFYING_PIDS — 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§fn eq(&self, other: &DeviceRoute) -> bool
fn eq(&self, other: &DeviceRoute) -> bool
self and other values to be equal, and is used by ==.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.