feat: reporter — HMAC-signed hourly POST with 24-record offline buffer
Fix Arduino String .size() → .length() in hmac.cpp (pre-existing bug surfaced by compilation). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
20
firmware/src/reporter.h
Normal file
20
firmware/src/reporter.h
Normal file
@@ -0,0 +1,20 @@
|
||||
// firmware/src/reporter.h
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
#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 = "https://logs.research.bike";
|
||||
|
||||
void reporter_submit_camera(const DeviceConfig& cfg, const CameraHourlyRecord& rec);
|
||||
void reporter_submit_ble(const DeviceConfig& cfg, const BLEHourlyRecord& rec);
|
||||
void reporter_heartbeat(const DeviceConfig& cfg, uint32_t uptime_s, int wifi_rssi);
|
||||
void reporter_flush(const DeviceConfig& cfg);
|
||||
Reference in New Issue
Block a user