| Crates.io | aranet-types |
| lib.rs | aranet-types |
| version | 0.1.9 |
| created_at | 2026-01-16 19:26:29.877365+00 |
| updated_at | 2026-01-22 03:18:34.364951+00 |
| description | Platform-agnostic types for Aranet environmental sensors |
| homepage | |
| repository | https://github.com/cameronrye/aranet |
| max_upload_size | |
| id | 2049134 |
| size | 99,480 |
Platform-agnostic types for Aranet environmental sensors.
This crate provides shared types that can be used by both native and WebAssembly implementations for interacting with Aranet devices (Aranet4, Aranet2, Aranet Radon, Aranet Radiation).
| Device | Measurements |
|---|---|
| Aranet4 | CO₂, temperature, humidity, pressure |
| Aranet2 | Temperature, humidity |
| Aranet Radon | Temperature, humidity, pressure, radon, 24h/7d/30d averages |
| Aranet Radiation | Radiation rate/total |
[dependencies]
aranet-types = "0.1"
To disable serde support:
[dependencies]
aranet-types = { version = "0.1", default-features = false }
use aranet_types::{CurrentReading, Status, DeviceType};
// Parse raw BLE data
let bytes: [u8; 13] = [/* ... */];
let reading = CurrentReading::from_bytes(&bytes)?;
println!("CO₂: {} ppm", reading.co2);
println!("Temperature: {:.1}°C", reading.temperature);
println!("Status: {}", reading.status);
// Use the builder pattern
let reading = CurrentReading::builder()
.co2(800)
.temperature(22.5)
.humidity(45)
.build();
// Device-specific parsing
let reading = CurrentReading::from_bytes_for_device(&data, DeviceType::Aranet2)?;
| Feature | Default | Description |
|---|---|---|
serde |
Yes | Enables serialization/deserialization support |
This crate is part of the aranet workspace:
| Crate | crates.io | Description |
|---|---|---|
| aranet-core | Core BLE library for device communication | |
| aranet-store | Local data persistence | |
| aranet-cli | Command-line interface | |
| aranet-tui | Terminal UI dashboard | |
| aranet-service | - | Background collector and REST API |
| aranet-gui | - | Desktop GUI application |
| aranet-wasm | - | WebAssembly module |
MIT
Made with ❤️ by Cameron Rye