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.
Loading...
Searching...
No Matches
wifi_http.h File Reference

HTTP routes of the WiFi setup page and its JSON API. More...

#include <esp_http_server.h>

Go to the source code of this file.

Functions

void register_wifi_routes (httpd_handle_t server, WifiManager &wifi)
 Registers /wifi, /api/wifi/status|scan|saved, POST /api/wifi/add|forget and the catch-all GET /*.
 

Detailed Description

HTTP routes of the WiFi setup page and its JSON API.

Function Documentation

◆ register_wifi_routes()

void register_wifi_routes ( httpd_handle_t server,
WifiManager & wifi )

Registers /wifi, /api/wifi/status|scan|saved, POST /api/wifi/add|forget and the catch-all GET /*.

The server must use httpd_uri_match_wildcard, and this must be called after every other route: the catch-all matches anything, so exact routes registered earlier win. In setup mode the catch-all answers 302 to http://192.168.4.1/wifi (phone captive-portal probes request arbitrary hostnames), otherwise 404. Only POSTs are origin-checked. Passwords and PINs are never logged or returned.

Parameters
serverRunning httpd instance.
wifiManager the handlers read and update; must outlive the server.