@@ -42,6 +42,7 @@ License (MIT license):
4242#include " WiFi.h"
4343#include < functional>
4444#include " esp_wifi.h"
45+ #include " esp_wifi_types.h"
4546
4647// Add quotes around defined value
4748#ifdef __IN_ECLIPSE__
@@ -111,18 +112,18 @@ void MDNSResponder::disableArduino(){
111112 }
112113}
113114
114- // void MDNSResponder::enableWorkstation(esp_interface_t interface){
115- // char winstance[21+_hostname.length()];
116- // uint8_t mac[6];
117- // esp_wifi_get_mac((wifi_interface_t)interface, mac);
118- // sprintf(winstance, "%s [%02x:%02x:%02x:%02x:%02x:%02x]", _hostname.c_str(), mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
119-
120- // if(mdns_service_add(NULL, "_workstation", "_tcp", 9, NULL, 0)) {
121- // log_e("Failed adding Workstation service");
122- // } else if(mdns_service_instance_name_set("_workstation", "_tcp", winstance)) {
123- // log_e("Failed setting Workstation service instance name");
124- // }
125- // }
115+ void MDNSResponder::enableWorkstation (esp_interface_t interface){
116+ char winstance[21 +_hostname.length ()];
117+ uint8_t mac[6 ];
118+ esp_wifi_get_mac ((wifi_interface_t )interface, mac);
119+ sprintf (winstance, " %s [%02x:%02x:%02x:%02x:%02x:%02x]" , _hostname.c_str (), mac[0 ], mac[1 ], mac[2 ], mac[3 ], mac[4 ], mac[5 ]);
120+
121+ if (mdns_service_add (NULL , " _workstation" , " _tcp" , 9 , NULL , 0 )) {
122+ log_e (" Failed adding Workstation service" );
123+ } else if (mdns_service_instance_name_set (" _workstation" , " _tcp" , winstance)) {
124+ log_e (" Failed setting Workstation service instance name" );
125+ }
126+ }
126127
127128void MDNSResponder::disableWorkstation (){
128129 if (mdns_service_remove (" _workstation" , " _tcp" )) {
0 commit comments