Giter Site home page Giter Site logo

dje98 / aircontrol Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 121 KB

A Rust Library for Dostmann TFA AIRCO2NTROL Devices

Home Page: https://crates.io/crates/aircontrol

License: MIT License

Rust 100.00%
airco2ntrol co2 co2-sensor cross-platform hardware-interface iot rust sensors tfa dostmann

aircontrol's Introduction

AirControl: a Rust Library for Dostmann TFA AIRCO2NTROL Devices

AirControl Logo

This Rust module provides a high-level interface for interacting with Dostmann TFA AIRCO2NTROL Mini and Coach devices, focusing on monitoring environmental parameters like CO2 levels, temperature, and humidity. It utilizes the hidapi library for cross-platform HID communication, ensuring a structured and multithreaded approach to data acquisition and event handling.

Features

  • Real-Time Monitoring: Track CO2 levels, temperature, and humidity in real-time.
  • Cross-Platform: Built on top of the hidapi library, ensuring compatibility across different operating systems.
  • Event-Driven: Utilizes callbacks to handle new data, making it easy to integrate with other systems or UIs.
  • Multithreaded Design: Ensures non-blocking data acquisition and processing.

Installation

To add this module in your project, use the following command:

cargo add aircontrol

Usage

Here is a simple example of how to use this interface to monitor environmental parameters:

use aircontrol::AirControl;

fn main() {
    let mut air_control = AirControl::new().expect("Failed to initialize the AirControl interface");

    // The new result will be printed with every update.
    air_control.register_callback(Box::new(|time, co2, temperature, humidity| {
        println!("{} - CO2: {} ppm, Temp: {}°C, Humidity: {}%", time, co2, temperature, humidity);
    }));

    // The monitoring runs on a separate thread and will invoke the callback with new data.
    air_control.start_monitoring();
    

    // Remember to gracefully stop the monitoring when your application is closing or when you need to stop it.
    air_control.stop_monitoring();
}

Contributing

Contributions to this project are welcome. Please adhere to the following guidelines:

  • Fork the repository and create a new branch for your feature or bug fix.
  • Write clean and documented code.
  • Ensure your changes do not break existing functionality.
  • Submit a pull request with a comprehensive description of your changes.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

This library is developed by @DJE98. Thanks to the hidapi library developers and contributors for providing a robust cross-platform HID communication solution.

aircontrol's People

Contributors

dje98 avatar

Stargazers

Robert Jeutter avatar

Watchers

 avatar

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.