pub struct ReprogControlsV4 { /* private fields */ }Expand description
ReprogControlsV4 accessor bound to one device + resolved feature index.
Construct with the feature index obtained from the device’s root feature
(get_feature(FEATURE_ID)), then call the functions below. Cheap to
clone (an Arc plus two indices).
Implementations§
Source§impl ReprogControlsV4
impl ReprogControlsV4
Sourcepub fn new(chan: Arc<HidppChannel>, device_index: u8, feature_index: u8) -> Self
pub fn new(chan: Arc<HidppChannel>, device_index: u8, feature_index: u8) -> Self
Bind the feature to (device_index, feature_index) on chan.
Sourcepub fn feature_index(&self) -> u8
pub fn feature_index(&self) -> u8
The feature index this accessor talks to — used to match unsolicited
events in decode_event.
Sourcepub fn device_index(&self) -> u8
pub fn device_index(&self) -> u8
The device index this accessor talks to.
Sourcepub async fn get_count(&self) -> Result<u8, Hidpp20Error>
pub async fn get_count(&self) -> Result<u8, Hidpp20Error>
Number of reprogrammable controls the device exposes.
Sourcepub async fn get_cid_info(&self, index: u8) -> Result<CidInfo, Hidpp20Error>
pub async fn get_cid_info(&self, index: u8) -> Result<CidInfo, Hidpp20Error>
Identity + capabilities of the control at index (0..get_count).
Sourcepub async fn get_ctrl_id_info(
&self,
index: u8,
) -> Result<CtrlIdInfo, Hidpp20Error>
pub async fn get_ctrl_id_info( &self, index: u8, ) -> Result<CtrlIdInfo, Hidpp20Error>
Compatibility projection of Self::get_cid_info.
Sourcepub async fn find_cid_info(
&self,
cid: ControlId,
) -> Result<Option<CidInfo>, Hidpp20Error>
pub async fn find_cid_info( &self, cid: ControlId, ) -> Result<Option<CidInfo>, Hidpp20Error>
Scan the control table for the control with cid. None if the device
doesn’t expose it.
Sourcepub async fn find_control(
&self,
cid: u16,
) -> Result<Option<CtrlIdInfo>, Hidpp20Error>
pub async fn find_control( &self, cid: u16, ) -> Result<Option<CtrlIdInfo>, Hidpp20Error>
Compatibility projection of Self::find_cid_info.
Sourcepub async fn get_cid_reporting(
&self,
cid: u16,
) -> Result<CidReporting, Hidpp20Error>
pub async fn get_cid_reporting( &self, cid: u16, ) -> Result<CidReporting, Hidpp20Error>
Current reporting/remapping state for cid.
Sourcepub async fn set_cid_reporting_full(
&self,
cid: u16,
change: CidReportingChange,
) -> Result<CidReportingChangeEcho, Hidpp20Error>
pub async fn set_cid_reporting_full( &self, cid: u16, change: CidReportingChange, ) -> Result<CidReportingChangeEcho, Hidpp20Error>
Apply the full setCidReporting packet.
Sourcepub async fn get_capabilities(
&self,
) -> Result<ReprogControlsCapabilities, Hidpp20Error>
pub async fn get_capabilities( &self, ) -> Result<ReprogControlsCapabilities, Hidpp20Error>
Feature-level v6 capabilities.
Sourcepub async fn reset_all_cid_report_settings(&self) -> Result<(), Hidpp20Error>
pub async fn reset_all_cid_report_settings(&self) -> Result<(), Hidpp20Error>
Reset all diverted/remapped control report settings on v6 devices that advertise this capability.
Sourcepub async fn set_cid_reporting(
&self,
cid: u16,
diverted: bool,
raw_xy: bool,
) -> Result<(), Hidpp20Error>
pub async fn set_cid_reporting( &self, cid: u16, diverted: bool, raw_xy: bool, ) -> Result<(), Hidpp20Error>
Set (or clear) temporary diversion and raw-XY reporting for cid.
remap is left at 0 (no persistent remapping). After enabling, the
device emits RawControlEvents on this feature index; clear both flags
on teardown to hand the control back to the firmware.
Trait Implementations§
Source§impl Clone for ReprogControlsV4
impl Clone for ReprogControlsV4
Source§fn clone(&self) -> ReprogControlsV4
fn clone(&self) -> ReprogControlsV4
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more