Module history

Source
Expand description

Historical data download.

This module provides functionality to download historical sensor readings stored on an Aranet device.

§Supported Devices

DeviceHistory SupportNotes
Aranet4FullCO₂, temperature, pressure, humidity
Aranet2FullTemperature, humidity
AranetRn+ (Radon)FullRadon, temperature, pressure, humidity
Aranet RadiationNot supportedBLE protocol undocumented by manufacturer

Note: Aranet Radiation devices do not support history download because the BLE protocol for historical radiation data is not publicly documented by SAF Tehnika. Attempting to download history will return Error::Unsupported. Use Device::read_current() for current radiation readings.

§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§

HistoryCheckpoint
Checkpoint data for resuming interrupted history downloads.
HistoryInfo
Information about the device’s stored history.
HistoryOptions
Options for downloading history.
HistoryProgress
Progress information for history download.
PartialHistoryData
Partially downloaded history data for checkpoint resume.

Enums§

HistoryParam
Parameter types for history requests.
HistoryParamCheckpoint
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§

CheckpointCallback
Type alias for checkpoint callback function.
ProgressCallback
Type alias for progress callback function.