pub struct Receiver { /* private fields */ }Expand description
Implements the Unifying wireless receiver.
Implementations§
Source§impl Receiver
impl Receiver
Sourcepub fn new(chan: Arc<HidppChannel>) -> Result<Self, ReceiverError>
pub fn new(chan: Arc<HidppChannel>) -> Result<Self, ReceiverError>
Tries to initialize a new Receiver from a raw HID++ channel.
Returns ReceiverError::UnknownReceiver when the channel’s VID/PID
doesn’t match any known Unifying receiver.
Sourcepub async fn count_pairings(&self) -> Result<u8, ReceiverError>
pub async fn count_pairings(&self) -> Result<u8, ReceiverError>
Counts the number of devices currently paired to this receiver. Offline (sleeping) devices are included since pairings are persistent.
Sourcepub async fn set_wireless_notifications(
&self,
enabled: bool,
) -> Result<(), ReceiverError>
pub async fn set_wireless_notifications( &self, enabled: bool, ) -> Result<(), ReceiverError>
Enables or disables wireless device-connection notifications.
The receiver only re-broadcasts 0x41 device-arrival events (the source
for Self::trigger_device_arrival) while this is on. With it off the
trigger write is ACK’d but emits nothing — which is why a paired, online
device can fail to enumerate. Solaar enables this before listing.
Read-modify-write of just the WIRELESS bit so it can’t clobber other
flags already set on register 0x00 — notably SOFTWARE_PRESENT (0x08),
which the pairing flow enables (pairing.rs writes [0x00, 0x09, 0x00])
and a concurrent inventory poll would otherwise drop.
Sourcepub async fn trigger_device_arrival(&self) -> Result<(), ReceiverError>
pub async fn trigger_device_arrival(&self) -> Result<(), ReceiverError>
Triggers device-arrival notifications for all currently connected devices. Used to enumerate online devices at startup.
Sourcepub async fn get_receiver_info(&self) -> Result<ReceiverInfo, ReceiverError>
pub async fn get_receiver_info(&self) -> Result<ReceiverInfo, ReceiverError>
Provides general information about the receiver (serial number and pairing slot count).
Sourcepub async fn get_device_pairing_information(
&self,
device_index: u8,
) -> Result<DevicePairingInformation, ReceiverError>
pub async fn get_device_pairing_information( &self, device_index: u8, ) -> Result<DevicePairingInformation, ReceiverError>
Retrieves the pairing information for the device at device_index
(1-based slot number).
Sourcepub async fn get_unique_id(&self) -> Result<String, ReceiverError>
pub async fn get_unique_id(&self) -> Result<String, ReceiverError>
Provides the unique ID of the receiver (serial number).