|
DeterministicESPAsyncWebServer v6.28.0
Zero-allocation, bounded-execution async HTTP server for ESP32
|
Optional mDNS / DNS-SD advertisement (DETWS_ENABLE_MDNS). More...
Go to the source code of this file.
Functions | |
| bool | detws_mdns_begin (const char *hostname, uint16_t http_port=80) |
| Start mDNS responder and advertise an HTTP service. | |
| bool | detws_mdns_txt (const char *key, const char *value) |
Add a TXT key/value record to the advertised _http._tcp service. | |
| bool | detws_mdns_add_service (const char *service_type, const char *proto, uint16_t port) |
Advertise an additional service, e.g. ("_https", "_tcp", 443). | |
Optional mDNS / DNS-SD advertisement (DETWS_ENABLE_MDNS).
Thin wrapper over the ESP-IDF mdns component so a headless device is reachable at <hostname>.local and advertises an _http._tcp service for browsers and Bonjour / DNS-SD tools (with optional TXT records and extra service types). Compiled to a no-op stub when DETWS_ENABLE_MDNS is 0 or on non-Arduino builds, so it costs nothing unless enabled.
Definition in file mdns_service.h.
| bool detws_mdns_begin | ( | const char * | hostname, |
| uint16_t | http_port = 80 |
||
| ) |
Start mDNS responder and advertise an HTTP service.
Call once after the WiFi link is up (wifi_ready()) and after begin(). The device becomes reachable at <hostname>.local and advertises _http._tcp on http_port.
| hostname | Host label without the .local suffix (e.g. "mydevice"). |
| http_port | TCP port the HTTP server listens on (default 80). |
Definition at line 49 of file mdns_service.cpp.
| bool detws_mdns_txt | ( | const char * | key, |
| const char * | value | ||
| ) |
Add a TXT key/value record to the advertised _http._tcp service.
Bonjour / DNS-SD browsers display these (e.g. "path"="/", "fw"="1.2.3"). Call after detws_mdns_begin().
| bool detws_mdns_add_service | ( | const char * | service_type, |
| const char * | proto, | ||
| uint16_t | port | ||
| ) |
Advertise an additional service, e.g. ("_https", "_tcp", 443).
| service_type | DNS-SD service type, e.g. "_https". |
| proto | "_tcp" or "_udp". |
| port | TCP/UDP port the service listens on. |