8#include <esp_http_server.h>
57 size_t build_reply(
char* out,
size_t size)
const;
59 httpd_handle_t _server_handle;
Abstract interface for object detection logic on ESP32-CAM.
An abstract base class (Interface) that defines the contract for detection algorithms....
Definition base_detection_module.h:22
Interface for anything that can report a ControlStatus (the Controller). Lets the network layer read ...
Definition control_status.h:46
The /commands WebSocket: parses each HUD message, hands it to the remote sink and replies with JSON m...
Definition commands_handler.h:18
void register_endpoint()
Registers the WebSocket endpoint on the server.
Definition commands_handler.cpp:26
static constexpr size_t kMaxMessage
Longest accepted message in bytes; the longest real command ("move:down-right") is 15.
Definition commands_handler.h:43
static esp_err_t websocket_handler(httpd_req_t *req)
httpd callback for /commands: parses one text frame and sends the JSON reply (the handshake goes to t...
Definition commands_handler.cpp:59
static esp_err_t pre_handshake(httpd_req_t *req)
ws_pre_handshake_cb: refuses pages from other origins before the 101 upgrade reply (ESP_FAIL refuses)...
Definition commands_handler.cpp:47
void unregister_endpoint()
Removes the endpoint from the server.
Definition commands_handler.cpp:41
static esp_err_t post_handshake(httpd_req_t *req)
ws_post_handshake_cb: logs the new session once it is a WebSocket.
Definition commands_handler.cpp:52
CommandsWebSocketHandler(httpd_handle_t server_handle, const char *uri, BaseDetectionModule *detection=nullptr, const BaseStatusProvider *status=nullptr, remote::BaseRemoteSink *remote=nullptr, const StreamBroadcaster *stream=nullptr)
Definition commands_handler.cpp:16
Definition stream_broadcaster.h:27
Receives parsed commands; implemented by the controller (device) and fakes (tests).
Definition remote_command.h:54
Read-only view of the controller state for the HUD and stats line.
Parses the HUD's /commands text messages into typed commands (pure C++20, natively tested).
Pushes the latest camera frame to each idle /stream WebSocket viewer (drop-when-busy,...