12 releases
Uses new Rust 2024
| new 0.1.12 | Feb 2, 2026 |
|---|---|
| 0.1.11 | Feb 1, 2026 |
| 0.1.9 | Jan 22, 2026 |
#188 in Embedded development
Used in 6 crates
(4 directly)
86KB
1.5K
SLoC
aranet-types
Platform-agnostic types for Aranet environmental sensors.
This crate provides shared types for interacting with Aranet devices (Aranet4, Aranet2, Aranet Radon, Aranet Radiation).
Features
- Core data types for sensor readings (CO₂, temperature, humidity, pressure, radon, radiation)
- Device information structures for device metadata
- UUID constants for BLE characteristics
- Error types for data parsing
- Serde support (enabled by default) for serialization/deserialization
Supported Devices
| 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 |
Installation
[dependencies]
aranet-types = "0.1"
To disable serde support:
[dependencies]
aranet-types = { version = "0.1", default-features = false }
Usage
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 Flags
| Feature | Default | Description |
|---|---|---|
serde |
Yes | Enables serialization/deserialization support |
Related Crates
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 |
License
MIT
Made with ❤️ by Cameron Rye
Dependencies
~1.5–2.4MB
~47K SLoC