// firmware/src/reporter.h #pragma once #include #include "config.h" #include "ble_scanner.h" struct CameraHourlyRecord { uint32_t period_start; uint32_t period_end; int entries; int exits; }; static const int REPORTER_MAX_BUFFER = 24; static const char* REPORTER_API_HOST_NAME = "logs.research.bike"; static const uint16_t REPORTER_API_PORT = 80; // Hardcoded fallback used when DNS fails (some customer networks intercept // :53 with a transparent proxy that mangles responses). Update if the // server's IP changes — but a successful hostByName() always wins over this. static const char* REPORTER_API_FALLBACK_IP = "5.78.114.131"; void reporter_init(); void reporter_submit_camera(const DeviceConfig& cfg, const CameraHourlyRecord& rec); void reporter_submit_ble(const DeviceConfig& cfg, const BLEHourlyRecord& rec); bool reporter_heartbeat(const DeviceConfig& cfg, uint32_t uptime_s, int wifi_rssi); void reporter_flush(const DeviceConfig& cfg);