diff --git a/common/forth_namespace_tests.fs b/common/forth_namespace_tests.fs index efd6312..4a8da26 100644 --- a/common/forth_namespace_tests.fs +++ b/common/forth_namespace_tests.fs @@ -688,6 +688,9 @@ e: check-esp32-builtins check-files-dir-reverse out: dacWrite out: MDNS.begin + out: MDNS.addService + out: MDNS.setInstanceName + out: MDNS.addServiceTxt ;e e: check-esp32-bindings diff --git a/esp32/builtins.h b/esp32/builtins.h index 74b37a6..6ce4199 100644 --- a/esp32/builtins.h +++ b/esp32/builtins.h @@ -425,5 +425,9 @@ static cell_t FromIP(IPAddress ip) { # endif # define OPTIONAL_MDNS_SUPPORT \ /* mDNS */ \ - X("MDNS.begin", MDNS_BEGIN, n0 = MDNS.begin(c0)) + X("MDNS.begin", MDNS_BEGIN, n0 = MDNS.begin(c0) ? -1 : 0) \ + X("MDNS.addService", MDNS_ADD_SERVICE, n0 = MDNS.addService(c2, c1, n0) ? -1 : 0; NIPn(2)) \ + X("MDNS.setInstanceName", MDNS_SET_INSTANCE_NAME, MDNS.setInstanceName(c0); DROP) \ + X("MDNS.addServiceTxt", MDNS_ADD_SERVICE_TXT, MDNS.addServiceTxt(c3, c2, c1, c0); DROPn(4)) + /* alx */ #endif diff --git a/site/ESP32forth.html b/site/ESP32forth.html index 507ef53..6ede5a0 100644 --- a/site/ESP32forth.html +++ b/site/ESP32forth.html @@ -472,7 +472,10 @@
WiFi
mDNS
-MDNS.begin ( name-z -- )   Start multicast dns
+MDNS.begin ( hostname-z -- f )   Start multicast dns
+MDNS.setInstanceName ( name-z -- )   Set the instance (friendly) name
+MDNS.addService ( service-z protocol-z port-n -- f )   Advertise a service (such as "http") using a protocol ("tcp" or "udp") and a port number.
+MDNS.addServiceTxt ( service-z protocol-z key-z value-z -- )   Add a service key/value pair
 
SPIFFS