#ifndef EVENT_RECORDER_H
#define EVENT_RECORDER_H

#include "stdc_post_process.h"

/*
 * event_recorder — golf cart violation event logger
 *
 * Two channels:
 *   A) Real-time JSON  → UART → DX-BT24 BLE → iPad       (bt_uart_send_json)
 *   B) tar.gz archive  → POST <upload_url>                (OOB / cloud path)
 *      Simulation:  http://192.168.0.114:8081/api/upload
 *      Production:  http://192.168.0.99/api/golf.cgi
 *
 * Grass events use a 4-level state machine (L1/L2/L3/resolved).
 * Hazard + person events are single-shot.
 *
 * Call order (same as capture_upload pattern):
 *   event_recorder_init()       — once, from loadConfig()
 *   event_recorder_update()     — every frame, from app_header_recv_inference
 *   event_recorder_provide_frame() — every frame, from app_header_send_inference
 */

/* Call once after INI is loaded (before VMF starts).
 * bt_uart_init() must be called before this. */
void event_recorder_init(const char *upload_url,
                         const char *sd_path,
                         int         sd_max_mb,
                         int         upload_delay_ms,
                         int         enable);

/* Drive the state machine — call from app_header_recv_inference. */
void event_recorder_update(const stdc_analysis_t *ana);

/* Take VMF_SNAP if one is pending — call from app_header_send_inference. */
void event_recorder_provide_frame(void);

#endif /* EVENT_RECORDER_H */
