aranet-types
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).
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
[]
= "0.1"
To disable serde support:
[]
= { = "0.1", = false }
Usage
use ;
// Parse raw BLE data
let bytes: = ;
let reading = from_bytes?;
println!;
println!;
println!;
// Use the builder pattern
let reading = builder
.co2
.temperature
.humidity
.build;
// Device-specific parsing
let reading = from_bytes_for_device?;
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 |
| aranet-wasm | - | WebAssembly module |
License
MIT
Made with ❤️ by Cameron Rye