DeterministicESPAsyncWebServer v6.28.0
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
mdns_service.cpp File Reference

mDNS / DNS-SD advertisement implementation (DETWS_ENABLE_MDNS). More...

#include "mdns_service.h"

Go to the source code of this file.

Functions

bool detws_mdns_begin (const char *hostname, uint16_t http_port)
 Start mDNS responder and advertise an HTTP service.
 

Detailed Description

mDNS / DNS-SD advertisement implementation (DETWS_ENABLE_MDNS).

Uses the ESP-IDF mdns component directly (not the Arduino ESPmDNS wrapper) so the only external dependency stays the base SDK + mbedTLS.

Definition in file mdns_service.cpp.

Function Documentation

◆ detws_mdns_begin()

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.

Parameters
hostnameHost label without the .local suffix (e.g. "mydevice").
http_portTCP port the HTTP server listens on (default 80).
Returns
true if the responder started; false if disabled at compile time, not on Arduino, or the mdns component failed to start.

Definition at line 49 of file mdns_service.cpp.