223 void on_live_telemetry(
float movement,
float threshold)
override;
224 void on_runtime_fault(
const char *message)
override;
227 void begin_callback_();
228 void end_callback_();
229 void apply_deferred_shutdown_();
233 RuntimeCapabilities capabilities_{};
234 std::unique_ptr<IEspectreRuntime> runtime_;
235 IRuntimeListener *listener_{
nullptr};
236 bool setup_complete_{
false};
237 bool services_armed_{
true};
238 bool live_telemetry_enabled_{
true};
239 uint8_t callback_depth_{0U};
240 bool shutdown_requested_{
false};
Everything the runtime tells your firmware.
The recommended entry point for firmware embedding ESPectre.
bool set_traffic_generator_mode_runtime(RuntimeTrafficMode mode)
Change the live internal traffic generator packet type.
RuntimeConfig & config()
Mutable access to the staged configuration.
bool set_threshold_runtime(float threshold)
Set the motion threshold, validating it against the active detector.
bool trigger_recalibration()
Restart startup calibration.
bool set_csi_traffic_mode_runtime(CsiTrafficMode mode)
Change the live CSI traffic ownership mode.
bool set_motion_hits_runtime(uint8_t motion_on_hits, uint8_t motion_off_hits)
Set the hit filter.
bool is_calibrating() const
True while the backend is calibrating.
bool setup(IRuntimeListener *listener)
Create the backend, apply the configuration, and start sensing.
void quiesce_for_ota()
Quiet the runtime ahead of an OTA update.
RuntimeDiagnosticsSnapshot diagnostics() const
Read backend counters without touching the cached sensing snapshot.
void shutdown()
Stop sensing and release the backend.
void set_config(const RuntimeConfig &config)
Stage the configuration used by the next setup().
bool services_armed() const
Current armed state, including before setup.
const RuntimeCapabilities & capabilities() const
What the active backend supports.
const RuntimeConfig & config() const
Read-only view of the staged configuration.
bool is_setup_complete() const
True between a successful setup() and the next shutdown().
void loop()
Advance runtime work and deliver pending listener callbacks.
void set_services_armed(bool armed)
Gate runtime-owned services without tearing the runtime down.
const RuntimeSnapshot & snapshot() const
Latest known snapshot, without querying the backend.
~RuntimeFrontendController() override
Shut the runtime down on scope exit.
void set_live_telemetry_enabled(bool enabled)
Enable or suppress IRuntimeListener::on_live_telemetry().
bool set_detection_algorithm_runtime(DetectionAlgorithm algorithm)
Switch detector while running.
RuntimeTrafficMode
Which packet the internal generator sends to solicit CSI from the AP.
CsiTrafficMode
Where the CSI-bearing traffic comes from.
DetectionAlgorithm
Which detector runs.
Runtime configuration and the backend contract behind it.
What a runtime actually offers its frontend.
Everything the runtime needs to know before setup().
Low-frequency counters and radio state used by optional diagnostic surfaces.
A consistent view of the sensing state at one instant.