14#if DETWS_ENABLE_MDNS && defined(ARDUINO)
20 if (!hostname || hostname[0] ==
'\0')
22 if (mdns_init() != ESP_OK)
24 if (mdns_hostname_set(hostname) != ESP_OK)
27 mdns_service_add(
nullptr,
"_http",
"_tcp", http_port,
nullptr, 0);
36 return mdns_service_txt_item_set(
"_http",
"_tcp", key, value) == ESP_OK;
41 if (!service_type || !proto)
44 return mdns_service_add(
nullptr, service_type, proto, port,
nullptr, 0) == ESP_OK;
bool detws_mdns_begin(const char *hostname, uint16_t http_port)
Start mDNS responder and advertise an HTTP service.
Optional mDNS / DNS-SD advertisement (DETWS_ENABLE_MDNS).
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).