feat: add HIL diagnostics and meter health handling

This commit is contained in:
2026-08-17 22:33:04 +02:00
parent bc2ac6e8f6
commit aa25aa2c12
30 changed files with 2108 additions and 236 deletions
+26
View File
@@ -0,0 +1,26 @@
#pragma once
#include <stdint.h>
enum class MeterHealthClassification : uint8_t {
Fresh = 0,
NoData,
Stale
};
struct MeterHealthState {
bool fault_active;
};
struct MeterHealthEvaluation {
bool ok;
bool fault_started;
bool recovered;
MeterHealthClassification classification;
};
MeterHealthEvaluation meter_health_evaluate(MeterHealthState &state,
bool has_snapshot,
uint32_t age_ms,
uint32_t max_age_ms);
const char *meter_health_classification_text(MeterHealthClassification classification);