Struct logitech_led_sdk::Sdk
source · pub struct Sdk(/* private fields */);
Expand description
Entry to Api.
This serves as proof of initalization and prevents the API from being used by other threads.
Implementations§
source§impl Sdk
impl Sdk
sourcepub fn new_with_name(name: &str) -> Option<Self>
pub fn new_with_name(name: &str) -> Option<Self>
sourcepub fn get_version(&self) -> Option<(u32, u32, u32)>
pub fn get_version(&self) -> Option<(u32, u32, u32)>
Returns the sdk version.
Returns
Returns a tuple of the major, minor and build numbers if successful. Returns None if the version could not be found.
sourcepub fn set_target(&self, target_device: TargetDevice) -> bool
pub fn set_target(&self, target_device: TargetDevice) -> bool
sourcepub fn set_lighting(&self, color: ColorPercent) -> bool
pub fn set_lighting(&self, color: ColorPercent) -> bool
sourcepub fn set_lighting_for_key_with_name(
&self,
key: KeyName,
color: ColorPercent
) -> bool
pub fn set_lighting_for_key_with_name( &self, key: KeyName, color: ColorPercent ) -> bool
sourcepub fn set_lighting_for_key_with_scan_code(
&self,
scan_code: u32,
color: ColorPercent
) -> bool
pub fn set_lighting_for_key_with_scan_code( &self, scan_code: u32, color: ColorPercent ) -> bool
sourcepub fn set_lighting_for_key_with_hid_code(
&self,
hid_code: u32,
color: ColorPercent
) -> bool
pub fn set_lighting_for_key_with_hid_code( &self, hid_code: u32, color: ColorPercent ) -> bool
sourcepub fn set_lighting_for_target_zone(
&self,
device: DeviceType,
zone: u32,
color: ColorPercent
) -> bool
pub fn set_lighting_for_target_zone( &self, device: DeviceType, zone: u32, color: ColorPercent ) -> bool
Sets the lighting for a specific device’s target zone.
A zone number is generally different per device, read the offical SDK docs for more info.
Returns
Returns true if successful.
sourcepub fn flash_lighting(
&self,
color: ColorPercent,
duration: Option<Duration>,
interval: Duration
) -> bool
pub fn flash_lighting( &self, color: ColorPercent, duration: Option<Duration>, interval: Duration ) -> bool
Save the current lighting, play the effect, and restore the lighting.
duration controls how long the flashes occur overall. If omitted, it will run until manually stopped. The interval is the time between flashes.
Returns
Returns false if the call fails or any of the time values are too large.
sourcepub fn flash_single_key(
&self,
key: KeyName,
color: ColorPercent,
duration: Option<Duration>,
interval: Duration
) -> bool
pub fn flash_single_key( &self, key: KeyName, color: ColorPercent, duration: Option<Duration>, interval: Duration ) -> bool
Start a flashing effect on the given key.
duration controls how long the flashes occur overall. If omitted, it will run until manually stopped. The interval is the time between flashes.
Returns
Returns false if the call fails or any of the time values are too large.
sourcepub fn stop_effects(&self) -> bool
pub fn stop_effects(&self) -> bool
sourcepub fn stop_effects_on_key(&self, key: KeyName) -> bool
pub fn stop_effects_on_key(&self, key: KeyName) -> bool
sourcepub fn pulse_lighting(
&self,
color: ColorPercent,
duration: Option<Duration>,
interval: Duration
) -> bool
pub fn pulse_lighting( &self, color: ColorPercent, duration: Option<Duration>, interval: Duration ) -> bool
Save the current lighting, pulse the lighting, then restore the lighting.
duration controls how long the pulses occur overall. If omitted, it will run until manually stopped. The interval is the time between pulses.
Returns
Returns false if the call fails or any of the time values are too large.
sourcepub fn pulse_single_key(
&self,
key: KeyName,
start_color: ColorPercent,
end_color: ColorPercent,
duration: Duration,
is_infinite: bool
) -> bool
pub fn pulse_single_key( &self, key: KeyName, start_color: ColorPercent, end_color: ColorPercent, duration: Duration, is_infinite: bool ) -> bool
Start a pulsing effect on the given key.
duration controls how long the pulses occur overall.
Returns
Returns false if the call fails or any of the time values are too large.