pub struct RootFeature { /* private fields */ }Expand description
Implements the Root / 0x0000 feature that every HID++2.0 device
supports by default.
This implementation is added automatically to any crate::device::Device
created using crate::device::Device::new.
Implementations§
Source§impl RootFeature
impl RootFeature
Sourcepub async fn get_feature(
&self,
id: u16,
) -> Result<Option<FeatureInformation>, Hidpp20Error>
pub async fn get_feature( &self, id: u16, ) -> Result<Option<FeatureInformation>, Hidpp20Error>
Retrieves information about a specific feature ID, including its index in the feature table, its type and its version.
If the feature is not supported by the device, None is returned.
If the device only supports the root feature version 1, the
FeatureInformation::version field will be 0 for all features.
Sourcepub async fn ping(&self, data: u8) -> Result<u8, Hidpp20Error>
pub async fn ping(&self, data: u8) -> Result<u8, Hidpp20Error>
Pings the device with an arbitrary data byte. The device will respond with the same data if communication succeeds.
The underlying function, as described in the protocol specification,
will also look up the protocol version supported by the device.
This is not implemented here, as the
crate::protocol::determine_version function does so in a more
general manner.
Trait Implementations§
Source§impl Clone for RootFeature
impl Clone for RootFeature
Source§fn clone(&self) -> RootFeature
fn clone(&self) -> RootFeature
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more