fix mDNS
This commit is contained in:
lumapu 2023-12-10 23:16:09 +01:00
parent 01b3e8f60a
commit e4ab7e9e5b
3 changed files with 18 additions and 0 deletions

View file

@ -2,6 +2,7 @@
## 0.8.18 - 2023-12-10
* copied even more from the original heuristic code #1259
* added mDNS support #1262
## 0.8.17 - 2023-12-10
* possible fix of NRF with opendtufusion (without ETH)

View file

@ -10,6 +10,7 @@
#define F(sl) (sl)
#endif
#include "ahoyeth.h"
#include <ESPmDNS.h>
//-----------------------------------------------------------------------------
ahoyeth::ahoyeth()
@ -170,6 +171,13 @@ void ahoyeth::onEthernetEvent(WiFiEvent_t event, arduino_event_info_t info)
ESP32_W5500_eth_connected = true;
mOnNetworkCB(true);
}
if (!MDNS.begin(mConfig->sys.deviceName)) {
DPRINTLN(DBG_ERROR, F("Error setting up MDNS responder!"));
} else {
DBGPRINT(F("[WiFi] mDNS established: "));
DBGPRINT(mConfig->sys.deviceName);
DBGPRINTLN(F(".local"));
}
break;
case ARDUINO_EVENT_ETH_DISCONNECTED:
@ -221,6 +229,13 @@ void ahoyeth::onEthernetEvent(WiFiEvent_t event, arduino_event_info_t info)
ESP32_W5500_eth_connected = true;
mOnNetworkCB(true);
}
if (!MDNS.begin(mConfig->sys.deviceName)) {
DPRINTLN(DBG_ERROR, F("Error setting up MDNS responder!"));
} else {
DBGPRINT(F("[WiFi] mDNS established: "));
DBGPRINT(mConfig->sys.deviceName);
DBGPRINTLN(F(".local"));
}
break;
case SYSTEM_EVENT_ETH_DISCONNECTED:

View file

@ -89,7 +89,9 @@ void ahoywifi::tickWifiLoop() {
if (mGotDisconnect) {
mStaConn = RESET;
}
#if !defined(ESP32)
MDNS.update();
#endif
return;
case IN_AP_MODE:
if (WiFi.softAPgetStationNum() == 0) {