ESPectre SDK 2.8.0-280-gac7af68
Wi-Fi CSI motion sensing for ESP32 firmware
Loading...
Searching...
No Matches
espectre::RuntimeSnapshot Struct Reference

A consistent view of the sensing state at one instant. More...

#include <runtime_snapshot.h>

Public Attributes

MotionState motion_state {MotionState::IDLE}
 Debounced motion state, after the motion_on_hits / motion_off_hits filter.
float movement_metric {0.0f}
 Current motion metric, on a 0..1 probability scale for both detectors.
float threshold {RUNTIME_SEGMENTATION_THRESHOLD_DEFAULT}
 Threshold movement_metric is compared against, on the same scale.
int8_t link_rssi_dbm {INT8_MIN}
 RSSI of the packets behind this metric.
uint8_t link_channel {0}
 Wi-Fi channel those packets arrived on.
bool calibrating {false}
 Startup calibration is running; detection results are not valid yet.
uint32_t calibration_packets {0}
 Packets observed by the current Lightweight startup calibrator.
uint16_t calibration_target_packets {0}
 Packet budget for the current Lightweight startup calibrator.
bool ready_to_publish {false}
 The runtime is calibrated, linked, and its output is safe to act on.
float startup_threshold {0.0f}
 Threshold startup calibration settled on.
const char * detector_name {"unknown"}
 Active detector label: "lightweight", "high_accuracy", or "stream" under RuntimeProfile::STREAM.
RuntimeSubcarrierSource subcarrier_source {RuntimeSubcarrierSource::FIXED_DEFAULT}
 How fixed_subcarriers was chosen.
SelectedSubcarriers fixed_subcarriers {make_default_subcarriers()}
 Subcarrier indices the detector is measuring on.

Detailed Description

A consistent view of the sensing state at one instant.

Passed to every IRuntimeListener callback and returned by RuntimeFrontendController::snapshot(). It is a plain value type: copy it freely, and copy it if you need it past the callback that delivered it.

Read ready_to_publish before anything else. The runtime keeps emitting snapshots while it calibrates, and motion_state is not meaningful until that flag is true.

Definition at line 76 of file runtime_snapshot.h.

Member Data Documentation

◆ motion_state

MotionState espectre::RuntimeSnapshot::motion_state {MotionState::IDLE}

Debounced motion state, after the motion_on_hits / motion_off_hits filter.

Definition at line 78 of file runtime_snapshot.h.

◆ movement_metric

float espectre::RuntimeSnapshot::movement_metric {0.0f}

Current motion metric, on a 0..1 probability scale for both detectors.

Comparable to threshold, but not comparable across detectors: Lightweight and ML produce the number differently even though the scale matches.

Definition at line 85 of file runtime_snapshot.h.

◆ threshold

float espectre::RuntimeSnapshot::threshold {RUNTIME_SEGMENTATION_THRESHOLD_DEFAULT}

Threshold movement_metric is compared against, on the same scale.

Definition at line 87 of file runtime_snapshot.h.

◆ link_rssi_dbm

int8_t espectre::RuntimeSnapshot::link_rssi_dbm {INT8_MIN}

RSSI of the packets behind this metric.

INT8_MIN when unknown.

Definition at line 92 of file runtime_snapshot.h.

◆ link_channel

uint8_t espectre::RuntimeSnapshot::link_channel {0}

Wi-Fi channel those packets arrived on.

Zero when unknown.

Definition at line 94 of file runtime_snapshot.h.

◆ calibrating

bool espectre::RuntimeSnapshot::calibrating {false}

Startup calibration is running; detection results are not valid yet.

Definition at line 96 of file runtime_snapshot.h.

◆ calibration_packets

uint32_t espectre::RuntimeSnapshot::calibration_packets {0}

Packets observed by the current Lightweight startup calibrator.

Zero when calibration is not running. Lightweight can finish early once motion evidence is accepted, so this may stay below calibration_target_packets.

Definition at line 103 of file runtime_snapshot.h.

◆ calibration_target_packets

uint16_t espectre::RuntimeSnapshot::calibration_target_packets {0}

Packet budget for the current Lightweight startup calibrator.

Zero when calibration is not running. csi:/miss: on the status heartbeat are last-second pipeline rates, not remaining calibration work.

Definition at line 110 of file runtime_snapshot.h.

◆ ready_to_publish

bool espectre::RuntimeSnapshot::ready_to_publish {false}

The runtime is calibrated, linked, and its output is safe to act on.

Gate every user-visible publication on this. It goes false again when the Wi-Fi link drops.

Definition at line 117 of file runtime_snapshot.h.

◆ startup_threshold

float espectre::RuntimeSnapshot::startup_threshold {0.0f}

Threshold startup calibration settled on.

Zero before it completes.

Definition at line 119 of file runtime_snapshot.h.

◆ detector_name

const char* espectre::RuntimeSnapshot::detector_name {"unknown"}

Active detector label: "lightweight", "high_accuracy", or "stream" under RuntimeProfile::STREAM.

Always a static string literal, so it stays valid for the process, but the pointer changes when the detector changes. parse_detection_algorithm() turns it back into a DetectionAlgorithm. Note these are the protocol names, not BaseDetector::get_name(), which is capitalized for logs.

Definition at line 129 of file runtime_snapshot.h.

◆ subcarrier_source

RuntimeSubcarrierSource espectre::RuntimeSnapshot::subcarrier_source {RuntimeSubcarrierSource::FIXED_DEFAULT}

How fixed_subcarriers was chosen.

Definition at line 131 of file runtime_snapshot.h.

◆ fixed_subcarriers

SelectedSubcarriers espectre::RuntimeSnapshot::fixed_subcarriers {make_default_subcarriers()}

Subcarrier indices the detector is measuring on.

Definition at line 133 of file runtime_snapshot.h.


The documentation for this struct was generated from the following file: