Module passive

Source
Expand description

Passive monitoring via BLE advertisements.

This module provides functionality to monitor Aranet devices without establishing a connection, using BLE advertisement data instead.

§Benefits

  • Lower power consumption: No connection overhead
  • More devices: Can monitor more than the BLE connection limit
  • Simpler: No connection management needed

§Requirements

Smart Home integration must be enabled on each device:

  • Go to device Settings > Smart Home > Enable

§Example

use aranet_core::passive::{PassiveMonitor, PassiveMonitorOptions};
use tokio_util::sync::CancellationToken;

let monitor = PassiveMonitor::new(PassiveMonitorOptions::default());
let cancel = CancellationToken::new();

// Start monitoring in background
let handle = monitor.start(cancel.clone());

// Receive readings
let mut rx = monitor.subscribe();
while let Ok(reading) = rx.recv().await {
    println!("Device: {} CO2: {:?}", reading.device_name, reading.data.co2);
}

Structs§

PassiveMonitor
Passive monitor for Aranet devices using BLE advertisements.
PassiveMonitorOptions
Options for passive monitoring.
PassiveReading
A reading from passive advertisement monitoring.