Browse Source

0.8.18

fix mDNS
pull/1263/head
lumapu 1 year ago
parent
commit
e4ab7e9e5b
  1. 1
      src/CHANGES.md
  2. 15
      src/eth/ahoyeth.cpp
  3. 2
      src/wifi/ahoywifi.cpp

1
src/CHANGES.md

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

15
src/eth/ahoyeth.cpp

@ -10,6 +10,7 @@
#define F(sl) (sl) #define F(sl) (sl)
#endif #endif
#include "ahoyeth.h" #include "ahoyeth.h"
#include <ESPmDNS.h>
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
ahoyeth::ahoyeth() ahoyeth::ahoyeth()
@ -170,6 +171,13 @@ void ahoyeth::onEthernetEvent(WiFiEvent_t event, arduino_event_info_t info)
ESP32_W5500_eth_connected = true; ESP32_W5500_eth_connected = true;
mOnNetworkCB(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; break;
case ARDUINO_EVENT_ETH_DISCONNECTED: 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; ESP32_W5500_eth_connected = true;
mOnNetworkCB(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; break;
case SYSTEM_EVENT_ETH_DISCONNECTED: case SYSTEM_EVENT_ETH_DISCONNECTED:

2
src/wifi/ahoywifi.cpp

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

Loading…
Cancel
Save