Expand description
Historical data download.
This module provides functionality to download historical sensor readings stored on an Aranet device.
§Supported Devices
| Device | History Support | Notes |
|---|---|---|
| Aranet4 | Full | CO₂, temperature, pressure, humidity |
| Aranet2 | Full | Temperature, humidity |
| AranetRn+ (Radon) | Full | Radon, temperature, pressure, humidity |
| Aranet Radiation | Not supported | Returns error - protocol undocumented |
Note: Aranet Radiation devices do not support history download. Attempting
to download history from an Aranet Radiation device will return an error.
Use Device::read_current() for
current radiation readings. The radiation_rate and radiation_total fields
in HistoryRecord are reserved for future implementation.
§Index Convention
All history indices are 1-based, following the Aranet device protocol:
- Index 1 = oldest reading
- Index N = newest reading (where N = total_readings)
This matches the device’s internal indexing. When specifying ranges:
ⓘ
let options = HistoryOptions {
start_index: Some(1), // First reading
end_index: Some(100), // 100th reading
..Default::default()
};§Protocols
Aranet devices support two history protocols:
- V1: Notification-based (older devices) - uses characteristic notifications
- V2: Read-based (newer devices, preferred) - direct read/write operations
Structs§
- History
Checkpoint - Checkpoint data for resuming interrupted history downloads.
- History
Info - Information about the device’s stored history.
- History
Options - Options for downloading history.
- History
Progress - Progress information for history download.
- Partial
History Data - Partially downloaded history data for checkpoint resume.
Enums§
- History
Param - Parameter types for history requests.
- History
Param Checkpoint - Serializable version of HistoryParam for checkpoints.
Functions§
- raw_
to_ pressure - Convert raw pressure value to hPa.
- raw_
to_ temperature - Convert raw temperature value to Celsius.
Type Aliases§
- Checkpoint
Callback - Type alias for checkpoint callback function.
- Progress
Callback - Type alias for progress callback function.