logitech-led-sdk

Crates.iologitech-led-sdk
lib.rslogitech-led-sdk
version0.1.1
sourcesrc
created_at2023-06-06 03:16:41.912525
updated_at2023-06-06 03:49:29.478224
descriptionA Rust binding for the Logitech LED SDK
homepagehttps://github.com/nathaniel-daniel/logitech-led-sdk-rs
repositoryhttps://github.com/nathaniel-daniel/logitech-led-sdk-rs
max_upload_size
id883484
size34,654
(nathaniel-daniel)

documentation

https://docs.rs/crate/logitech-led-sdk/latest/logitech_led_sdk/

README

logitech-led-sdk-rs

A Rust Binding for the Logitech LED Library. This was built and tested with v9.00. It will most likely work with LGS and definitely works with LG HUB. Due to a lack of documentation, the SDK is assumed to be single-threaded. The library will use internal synchronization to ensure accesses to the library are safe. The goal of this binding is to provide a wrapper for the SDK, not to provide a method to interact with LEDs on Logitech devices.

Documentation

Release: https://docs.rs/crate/logitech-led-sdk/latest/logitech_led_sdk/ Master: https://nathaniel-daniel.github.io/logitech-led-sdk-rs/logitech_led_sdk/

Building

You need to seperately download the LG SDK. You can find it publicly here.

Set the environment variable LOGITECH_LED_SDK to the LED folder from the downloaded zip sdk.

Example: LOGITECH_LED_SDK = C:\Users\[username]\Documents\code\LED_SDK_9.00\LED.

Example

use logitech_led_sdk::Sdk;
use logitech_led_sdk::ColorPercent;
use logitech_led_sdk::TargetDevice;

fn main() {
    /// Do not use `expect` in a real application.
    /// If this fails, its likely that the user does not have LGS or LG HUB installed.
    let sdk = Sdk::new_with_name("Test").expect("failed to initialize SDK");
    
    let version = sdk.get_version().expect("failed to get version");
    println!("Version: {:#?}", version);
    
    /// Do not use `assert!` in a real application.
    assert!(sdk.set_target(TargetDevice::All));
    assert!(sdk.set_lighting(ColorPercent::new_rgb(255, 255, 255)));
}

Testing

On a PC with either LGS or LG HUB running, run:

cargo test

License

Licensed under either of

at your option.

Contributing

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 43

cargo fmt