GithubHelp home page GithubHelp logo

nathaniel-daniel / logitech-led-sdk-rs Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 1.16 MB

A Rust Binding for the Logitech LED Library

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

License: Apache License 2.0

Rust 96.91% C 0.06% Python 3.03%
logitech logitech-sdk rust sdk bindings

logitech-led-sdk-rs's Introduction

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/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.

logitech-led-sdk-rs's People

Contributors

adumbidiot avatar dependabot-preview[bot] avatar dependabot[bot] avatar nathaniel-daniel avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

fenhl

logitech-led-sdk-rs's Issues

Put on crates.io?

Hi there, is there half a chance you could get this put on crates.io? I'm kinda new to rust and adding libs externally is not something I'm sure about, plus it would just generally be easier for everyone :P

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.