pub struct ColorLedEffectsFeature { /* private fields */ }Expand description
Implements the ColorLedEffects / 0x8070 feature.
Implementations§
Source§impl ColorLedEffectsFeature
impl ColorLedEffectsFeature
Sourcepub async fn get_info(&self) -> Result<ColorLedInfo, Hidpp20Error>
pub async fn get_info(&self) -> Result<ColorLedInfo, Hidpp20Error>
Retrieves the zone count and capability bitmasks.
Sourcepub async fn get_zone_info(
&self,
zone_index: u8,
) -> Result<ZoneInfo, Hidpp20Error>
pub async fn get_zone_info( &self, zone_index: u8, ) -> Result<ZoneInfo, Hidpp20Error>
Retrieves information about zone_index.
Sourcepub async fn get_zone_effect_info(
&self,
zone_index: u8,
zone_effect_index: u8,
) -> Result<ZoneEffectInfo, Hidpp20Error>
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.
Sourcepub async fn set_zone_effect(
&self,
zone_index: u8,
zone_effect_index: u8,
params: [u8; 10],
persistence: Persistence,
) -> Result<(), Hidpp20Error>
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.
Sourcepub async fn get_nv_config(
&self,
capability: NvCapabilities,
) -> Result<NvConfig, Hidpp20Error>
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.
Sourcepub async fn set_nv_config(
&self,
capability: NvCapabilities,
state: NvCapabilityState,
param1: u8,
param2: u8,
) -> Result<(), Hidpp20Error>
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).
Sourcepub async fn get_led_bin_info(
&self,
zone_index: u8,
led_bin_index: LedBinIndex,
) -> Result<LedBinInfo, Hidpp20Error>
pub async fn get_led_bin_info( &self, zone_index: u8, led_bin_index: LedBinIndex, ) -> Result<LedBinInfo, Hidpp20Error>
Reads manufacturing LED bin information.
Sourcepub async fn get_sw_control(&self) -> Result<SwControlState, Hidpp20Error>
pub async fn get_sw_control(&self) -> Result<SwControlState, Hidpp20Error>
Retrieves whether firmware or software owns the LEDs.
Sourcepub async fn set_sw_control(
&self,
control: SwControl,
sync_events: bool,
) -> Result<(), Hidpp20Error>
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.
Sourcepub async fn get_effect_settings(
&self,
zone_index: u8,
source: PersistenceSource,
) -> Result<EffectSettings, Hidpp20Error>
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.
Sourcepub async fn clear_effect_settings(
&self,
zone_index: u8,
) -> Result<(), Hidpp20Error>
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.
Sourcepub async fn set_cycling_direction(
&self,
direction: CyclingDirection,
) -> Result<(), Hidpp20Error>
pub async fn set_cycling_direction( &self, direction: CyclingDirection, ) -> Result<(), Hidpp20Error>
Sets the color-cycling direction.
Sourcepub async fn get_current_color(
&self,
zone_index: u8,
) -> Result<Rgb, Hidpp20Error>
pub async fn get_current_color( &self, zone_index: u8, ) -> Result<Rgb, Hidpp20Error>
Retrieves the color currently displayed by zone_index.
Sourcepub async fn synchronize_effect(
&self,
zone_index: u8,
drift_value: i16,
) -> Result<(), Hidpp20Error>
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.
Sourcepub async fn get_zone_effect(
&self,
zone_index: u8,
source: PersistenceSource,
) -> Result<ZoneEffect, Hidpp20Error>
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.
Sourcepub async fn set_led_bin_info(
&self,
info: &LedBinInfo,
) -> Result<LedBinInfo, Hidpp20Error>
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
impl CreatableFeature for ColorLedEffectsFeature
Source§const STARTING_VERSION: u8 = 0
const STARTING_VERSION: u8 = 0
Source§impl EmittingFeature<ColorLedEffectsEvent> for ColorLedEffectsFeature
impl EmittingFeature<ColorLedEffectsEvent> for ColorLedEffectsFeature
Source§fn listen(&self) -> Receiver<ColorLedEffectsEvent>
fn listen(&self) -> Receiver<ColorLedEffectsEvent>
T is emitted by the feature.