Skip to content

Commit

Permalink
0.8.18
Browse files Browse the repository at this point in the history
fix mDNS
  • Loading branch information
lumapu committed Dec 10, 2023
1 parent 01b3e8f commit e4ab7e9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 15 additions & 0 deletions src/eth/ahoyeth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#define F(sl) (sl)
#endif
#include "ahoyeth.h"
#include <ESPmDNS.h>

//-----------------------------------------------------------------------------
ahoyeth::ahoyeth()
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions src/wifi/ahoywifi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e4ab7e9

Please sign in to comment.