#ifndef HEALTH_REPORT_H
#define HEALTH_REPORT_H

#include "config.h"

// Pure raw-ADC-to-percentage conversion (no hardware access) -- extracted
// from health_read_battery_pct() so the boundary/clamping/interpolation
// math is directly unit-testable without a real ADC.
uint8_t health_battery_pct_from_raw_adc(int raw);

// Initialize health reporting subsystem
void health_init(uint32_t sensor_id);

// Call periodically from main loop. Returns true if a report was sent this call.
bool health_tick();

// Increment detection counter (call on each promoted detection)
void health_increment_detections();

// Update RSSI stats (call on each mesh receive)
void health_update_rssi(int16_t rssi);

// Read battery voltage and return percentage (0-100)
uint8_t health_read_battery_pct();

// Force an immediate health report
bool health_send_now();

// Print per-model stats to Serial (called during health tick when multi-model active)
void health_print_model_stats();

#endif // HEALTH_REPORT_H
