Skip to main content

ColorLedEffectsFeature

Struct ColorLedEffectsFeature 

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

Implements the ColorLedEffects / 0x8070 feature.

Implementations§

Source§

impl ColorLedEffectsFeature

Source

pub async fn get_info(&self) -> Result<ColorLedInfo, Hidpp20Error>

Retrieves the zone count and capability bitmasks.

Source

pub async fn get_zone_info( &self, zone_index: u8, ) -> Result<ZoneInfo, Hidpp20Error>

Retrieves information about zone_index.

Source

pub async fn get_zone_effect_info( &self, zone_index: u8, zone_effect_index: u8, ) -> Result<ZoneEffectInfo, Hidpp20Error>

Retrieves information about effect zone_effect_index of zone_index.

Source

pub async fn set_zone_effect( &self, zone_index: u8, zone_effect_index: u8, params: [u8; 10], persistence: Persistence, ) -> Result<(), Hidpp20Error>

Applies effect zone_effect_index to zone_index with effect-specific params.

The meaning of each parameter byte depends on the effect’s EffectId (discoverable with Self::get_zone_effect_info). For example, the EffectId::FixedColor effect uses the first three parameters as red, green and blue.

Source

pub async fn get_nv_config( &self, capability: NvCapabilities, ) -> Result<NvConfig, Hidpp20Error>

Reads one non-volatile configuration capability.

Exactly one NvCapabilities bit must be set.

Source

pub async fn set_nv_config( &self, capability: NvCapabilities, state: NvCapabilityState, param1: u8, param2: u8, ) -> Result<(), Hidpp20Error>

Writes one non-volatile configuration entry (to EEPROM, so use sparingly).

Source

pub async fn get_led_bin_info( &self, zone_index: u8, led_bin_index: LedBinIndex, ) -> Result<LedBinInfo, Hidpp20Error>

Reads manufacturing LED bin information.

Source

pub async fn get_sw_control(&self) -> Result<SwControlState, Hidpp20Error>

Retrieves whether firmware or software owns the LEDs.

Source

pub async fn set_sw_control( &self, control: SwControl, sync_events: bool, ) -> Result<(), Hidpp20Error>

Takes or releases software control of the LEDs.

sync_events enables the ColorLedEffectsEvent::SyncEffect event. This is not stored in EEPROM.

Source

pub async fn get_effect_settings( &self, zone_index: u8, source: PersistenceSource, ) -> Result<EffectSettings, Hidpp20Error>

Reads the effect settings of zone_index.

Not supported when ExtCapabilities::NO_GET_EFFECT_SETTINGS is set.

Source

pub async fn clear_effect_settings( &self, zone_index: u8, ) -> Result<(), Hidpp20Error>

Clears the effect settings of zone_index, reverting it to the default mode.

Source

pub async fn set_cycling_direction( &self, direction: CyclingDirection, ) -> Result<(), Hidpp20Error>

Sets the color-cycling direction.

Source

pub async fn get_current_color( &self, zone_index: u8, ) -> Result<Rgb, Hidpp20Error>

Retrieves the color currently displayed by zone_index.

Source

pub async fn synchronize_effect( &self, zone_index: u8, drift_value: i16, ) -> Result<(), Hidpp20Error>

Synchronizes effect timing across devices by applying a drift_value correction (milliseconds).

Valid only while sync events are enabled. A zone_index of 0xff targets all zones.

Source

pub async fn get_zone_effect( &self, zone_index: u8, source: PersistenceSource, ) -> Result<ZoneEffect, Hidpp20Error>

Retrieves the currently configured effect of zone_index.

Requires ExtCapabilities::GET_ZONE_EFFECT.

Source

pub async fn set_led_bin_info( &self, info: &LedBinInfo, ) -> Result<LedBinInfo, Hidpp20Error>

Stores manufacturing LED bin information and returns the device’s echo.

Requires ExtCapabilities::SET_LED_BIN_INFO.

Trait Implementations§

Source§

impl CreatableFeature for ColorLedEffectsFeature

Source§

const ID: u16 = 0x8070

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<ColorLedEffectsEvent> for ColorLedEffectsFeature

Source§

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

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

impl Feature for ColorLedEffectsFeature

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more