#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);
