ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
mdns_service.cpp File Reference

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

#include "mdns_service.h"

Go to the source code of this file.

Functions

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

Detailed Description

mDNS / DNS-SD advertisement implementation (PC_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

◆ pc_mdns_begin()

bool pc_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 59 of file mdns_service.cpp.