Skip to content

Commit eae568a

Browse files
committed
broadcast improvement
1 parent 3524c57 commit eae568a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/NetManager.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ void NetManager::getUDPStream() {
6767
Serial.println(remoteIpForUdp.toString());
6868
}
6969
} else {
70-
if (netManager.remoteIpForUdpBroadcast.toString().equals(remoteIpForUdp.toString())) {
70+
#if defined(ESP8266)
71+
if (!netManager.remoteIpForUdpBroadcast.isSet() || netManager.remoteIpForUdpBroadcast.toString().equals(remoteIpForUdp.toString())) {
72+
#elif defined(ARDUINO_ARCH_ESP32)
73+
if (netManager.remoteIpForUdpBroadcast.toString().equals(F("0.0.0.0")) || netManager.remoteIpForUdpBroadcast.toString().equals(remoteIpForUdp.toString())) {
74+
#endif
7175
char *p;
7276
p = strstr(packetBroadcast, PING);
7377
if (p) {

0 commit comments

Comments
 (0)