// stimulus.h — BOX-3 as a stimulus generator for the Freenove master's
// camera (QR) and microphone (melody). Lets the master's local puzzles be
// exercised end-to-end without printed cards or an instrument.
//
// REST (registered on the existing scenario_server httpd):
//   POST /stim/qr      {"text":"zacus-qr-1"}            -> show QR fullscreen
//   POST /stim/melody  {"notes":[60,62,64,65],"ms":400} -> play melody
#pragma once
#include "esp_err.h"
#include "esp_http_server.h"

#ifdef __cplusplus
extern "C" {
#endif

// Provided by main.c — play one tone (blocking) on the BOX-3 speaker.
void audio_play_tone(float frequency, int duration_ms);

// Build the QR screen (under bsp_display_lock). Call once after the display
// and UI are up.
esp_err_t stimulus_init(void);

// Register /stim/* routes on an existing server.
esp_err_t stimulus_register_routes(httpd_handle_t server);

#ifdef __cplusplus
}
#endif
