Crates.io | aranet-btle |
lib.rs | aranet-btle |
version | 0.1.2 |
source | src |
created_at | 2023-11-02 02:57:09.529655 |
updated_at | 2023-11-06 23:20:16.489097 |
description | A simple library to get readings from an Aranet4 co2 device |
homepage | |
repository | https://github.com/DDRBoxman/aranet-btle |
max_upload_size | |
id | 1022171 |
size | 35,349 |
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(())
}