pub struct ExtendedDpiFeature { /* private fields */ }Expand description
Implements the ExtendedAdjustableDpi / 0x2202 feature.
Implementations§
Source§impl ExtendedDpiFeature
impl ExtendedDpiFeature
Sourcepub async fn get_sensor_count(&self) -> Result<u8, Hidpp20Error>
pub async fn get_sensor_count(&self) -> Result<u8, Hidpp20Error>
Retrieves the number of motion sensors the device exposes.
Sourcepub async fn get_sensor_capabilities(
&self,
sensor_index: u8,
) -> Result<SensorCapabilitiesInfo, Hidpp20Error>
pub async fn get_sensor_capabilities( &self, sensor_index: u8, ) -> Result<SensorCapabilitiesInfo, Hidpp20Error>
Retrieves the capabilities and DPI-level count of sensor_index.
Sourcepub async fn get_sensor_dpi_ranges(
&self,
sensor_index: u8,
direction: DpiDirection,
) -> Result<Vec<DpiRange>, Hidpp20Error>
pub async fn get_sensor_dpi_ranges( &self, sensor_index: u8, direction: DpiDirection, ) -> Result<Vec<DpiRange>, Hidpp20Error>
Retrieves the supported DPI of sensor_index along direction as a mix
of fixed values and stepped ranges.
The device may split the description across several pages; this fetches
them until the 0x0000 end-of-list terminator is seen, then decodes the
accumulated stream. A device that never terminates the list within a
bounded number of pages yields Hidpp20Error::UnsupportedResponse.
Sourcepub async fn get_sensor_dpi_list(
&self,
sensor_index: u8,
direction: DpiDirection,
) -> Result<Vec<u16>, Hidpp20Error>
pub async fn get_sensor_dpi_list( &self, sensor_index: u8, direction: DpiDirection, ) -> Result<Vec<u16>, Hidpp20Error>
Retrieves the current profile’s DPI list for sensor_index along
direction.
Only meaningful when the sensor supports profiles
(SensorCapabilities::PROFILE); otherwise the device returns an error.
Sourcepub async fn get_sensor_lod_list(
&self,
sensor_index: u8,
dpi_level_count: u8,
) -> Result<Vec<Lod>, Hidpp20Error>
pub async fn get_sensor_lod_list( &self, sensor_index: u8, dpi_level_count: u8, ) -> Result<Vec<Lod>, Hidpp20Error>
Retrieves the current profile’s lift-off-distance list for
sensor_index.
The list length is the sensor’s DPI-level count
(SensorCapabilitiesInfo::dpi_level_count), which the caller passes as
dpi_level_count; the device does not delimit the list.
Sourcepub async fn get_sensor_dpi_parameters(
&self,
sensor_index: u8,
) -> Result<DpiParameters, Hidpp20Error>
pub async fn get_sensor_dpi_parameters( &self, sensor_index: u8, ) -> Result<DpiParameters, Hidpp20Error>
Retrieves the current and default DPI parameters of sensor_index.
Sourcepub async fn set_sensor_dpi_parameters(
&self,
sensor_index: u8,
params: SetDpiParameters,
) -> Result<(), Hidpp20Error>
pub async fn set_sensor_dpi_parameters( &self, sensor_index: u8, params: SetDpiParameters, ) -> Result<(), Hidpp20Error>
Sets the DPI and lift-off distance of sensor_index.
params.dpi_y must be 0 when the sensor has no independent Y axis.
Sourcepub async fn show_sensor_dpi_status(
&self,
sensor_index: u8,
params: ShowDpiStatus,
) -> Result<(), Hidpp20Error>
pub async fn show_sensor_dpi_status( &self, sensor_index: u8, params: ShowDpiStatus, ) -> Result<(), Hidpp20Error>
Asks the device to show params.dpi_level on its DPI status LED.
Valid only while the device is in host mode.
Sourcepub async fn get_dpi_calibration_info(
&self,
sensor_index: u8,
) -> Result<DpiCalibrationInfo, Hidpp20Error>
pub async fn get_dpi_calibration_info( &self, sensor_index: u8, ) -> Result<DpiCalibrationInfo, Hidpp20Error>
Retrieves the reference information needed to start a calibration of
sensor_index.
Sourcepub async fn start_dpi_calibration(
&self,
sensor_index: u8,
params: StartDpiCalibration,
) -> Result<(), Hidpp20Error>
pub async fn start_dpi_calibration( &self, sensor_index: u8, params: StartDpiCalibration, ) -> Result<(), Hidpp20Error>
Starts a DPI calibration of sensor_index.
Requires SensorCapabilities::CALIBRATION. The device reports the
outcome through an ExtendedDpiEvent::CalibrationCompleted event; for a
CalibrationType::Software calibration the result is then applied with
Self::set_dpi_calibration.
Sourcepub async fn set_dpi_calibration(
&self,
sensor_index: u8,
direction: DpiDirection,
correction: DpiCalibrationCorrection,
) -> Result<(), Hidpp20Error>
pub async fn set_dpi_calibration( &self, sensor_index: u8, direction: DpiDirection, correction: DpiCalibrationCorrection, ) -> Result<(), Hidpp20Error>
Applies a calibration correction to sensor_index along direction.
Allowed only while a calibration started by Self::start_dpi_calibration
is in progress (or to revert, see DpiCalibrationCorrection).
Trait Implementations§
Source§impl CreatableFeature for ExtendedDpiFeature
impl CreatableFeature for ExtendedDpiFeature
Source§const STARTING_VERSION: u8 = 0
const STARTING_VERSION: u8 = 0
Source§impl EmittingFeature<ExtendedDpiEvent> for ExtendedDpiFeature
impl EmittingFeature<ExtendedDpiEvent> for ExtendedDpiFeature
Source§fn listen(&self) -> Receiver<ExtendedDpiEvent>
fn listen(&self) -> Receiver<ExtendedDpiEvent>
T is emitted by the feature.