Skip to main content

ExtendedDpiFeature

Struct ExtendedDpiFeature 

Source
pub struct ExtendedDpiFeature { /* private fields */ }
Expand description

Implements the ExtendedAdjustableDpi / 0x2202 feature.

Implementations§

Source§

impl ExtendedDpiFeature

Source

pub async fn get_sensor_count(&self) -> Result<u8, Hidpp20Error>

Retrieves the number of motion sensors the device exposes.

Source

pub async fn get_sensor_capabilities( &self, sensor_index: u8, ) -> Result<SensorCapabilitiesInfo, Hidpp20Error>

Retrieves the capabilities and DPI-level count of sensor_index.

Source

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.

Source

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.

Source

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.

Source

pub async fn get_sensor_dpi_parameters( &self, sensor_index: u8, ) -> Result<DpiParameters, Hidpp20Error>

Retrieves the current and default DPI parameters of sensor_index.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source§

const ID: u16 = 0x2202

The protocol ID of the implemented feature.
Source§

const STARTING_VERSION: u8 = 0

The version of the feature the implementation starts to support.
Source§

fn new(chan: Arc<HidppChannel>, device_index: u8, feature_index: u8) -> Self

Creates a new instance of the feature implementation.
Source§

impl EmittingFeature<ExtendedDpiEvent> for ExtendedDpiFeature

Source§

fn listen(&self) -> Receiver<ExtendedDpiEvent>

Creates a receiver that is being notified whenever a new event of type T is emitted by the feature.
Source§

impl Feature for ExtendedDpiFeature

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V