|
Void Sentry
An AI-driven, real-time Sentry Turret platform leveraging asynchronous I/O and computer vision to deliver high-precision autonomous motion tracking on resource-constrained embedded hardware.
|
Manages the ESP32-CAM web interface and control API. More...
#include <turret_server.h>
Public Member Functions | |
| bool | start (FrameStore &store, BaseDetectionModule *detection=nullptr, const BaseStatusProvider *status=nullptr, remote::BaseRemoteSink *remote=nullptr, WifiManager *wifi=nullptr) |
| Configures and launches the web servers: port 80 (page, /commands, WiFi API) and port 81 (/stream only, own task so a stalled video send cannot block /commands replies). | |
| uint32_t | frames_sent () const |
| Frames successfully sent to /stream viewers since boot. | |
| StreamBroadcaster::SendStats | take_send_stats () |
| /stream send timing (see StreamBroadcaster::SendStats); resets the window max. | |
| size_t | viewer_count () const |
| Number of currently connected /stream viewers. | |
| void | stop () |
| Shut down both servers and unregister all URI handlers. | |
Static Public Member Functions | |
| static esp_err_t | index_handler (httpd_req_t *req) |
| HTTP handler for the root ("/") URI. This method is called by the ESP HTTP server whenever a client accesses the root IP address. It serves the primary web interface stored in Flash memory. | |
Manages the ESP32-CAM web interface and control API.
This class wraps the ESP-IDF HTTP server component. It provides a video stream endpoint and a command endpoint for remote movement.
|
static |
HTTP handler for the root ("/") URI. This method is called by the ESP HTTP server whenever a client accesses the root IP address. It serves the primary web interface stored in Flash memory.
HTTP GET handler for the root ("/") URI. This function serves the primary web interface of the turret. To optimize memory usage and transmission speed, it sends a Gzip-compressed HTML payload.
| req | Pointer to the HTTP request object containing session data. |
| [in] | req | Pointer to the HTTP request context provided by the ESP-IDF server. |
| bool HttpServer::start | ( | FrameStore & | store, |
| BaseDetectionModule * | detection = nullptr, | ||
| const BaseStatusProvider * | status = nullptr, | ||
| remote::BaseRemoteSink * | remote = nullptr, | ||
| WifiManager * | wifi = nullptr ) |
Configures and launches the web servers: port 80 (page, /commands, WiFi API) and port 81 (/stream only, own task so a stalled video send cannot block /commands replies).
| store | FrameStore the /stream endpoint reads frames from. Must outlive the server. |
| detection | Optional pointer to detection module for motion visualization. |
| status | Optional status provider (the Controller); when null the mode/calibration fields are omitted. |
| remote | Optional sink for the HUD's /commands messages (the Controller); when null they are ignored. |
| wifi | Optional WiFi manager; when set, the setup page, its JSON API and the captive-portal catch-all are registered (after all other routes). |