aranet-btle

Crates.ioaranet-btle
lib.rsaranet-btle
version0.1.2
sourcesrc
created_at2023-11-02 02:57:09.529655
updated_at2023-11-06 23:20:16.489097
descriptionA simple library to get readings from an Aranet4 co2 device
homepage
repositoryhttps://github.com/DDRBoxman/aranet-btle
max_upload_size
id1022171
size35,349
Colin Edwards (DDRBoxman)

documentation

README

Aranet btle

A simple library to get readings from an Aranet4 co2 device

use aranet_btle;

use std::error::Error;

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    let device = aranet_btle::connect().await?;

    let data = device.read_data().await?;

    println!("co2: {}ppm", data.co2);
    println!("temperature: {}C", data.temperature);
    println!("pressure: {}hPa", data.pressure);
    println!("humidity: {}%", data.humidity);
    println!("battery: {}%", data.battery);
    println!("status: {}", data.status);
    println!("interval: {}", data.interval);
    println!("age: {}s", data.age);

    Ok(())
}

Roadmap:

  • Connect to one device
  • Get readings
  • Get readings from BTLE advertisements (scan)
  • Allow connecting to multiple devices
  • Connect to a specific device
  • Fetch sensor history data
  • Better management of the btle code so we can play nice with other libraries.
  • Allow selecting bluetooth adapter
Commit count: 6

cargo fmt