Skip to content

Commit f96ea40

Browse files
committed
port stopAllExcept to WiFiUDP to keep the interface the same
1 parent 966bf45 commit f96ea40

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

libraries/ESP8266WiFi/src/WiFiUdp.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,3 +290,12 @@ void WiFiUDP::stopAll()
290290
it->stop();
291291
}
292292
}
293+
294+
void WiFiUDP::stopAllExcept(WiFiUDP * exC) {
295+
for (WiFiUDP* it = _s_first; it; it = it->_next) {
296+
if (it->_ctx != exC->_ctx) {
297+
DEBUGV("%s %08x %08x\n", __func__, (uint32_t) it, (uint32_t) _s_first);
298+
it->stop();
299+
}
300+
}
301+
}

libraries/ESP8266WiFi/src/WiFiUdp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ class WiFiUDP : public UDP, public SList<WiFiUDP> {
105105
uint16_t localPort();
106106

107107
static void stopAll();
108+
static void stopAllExcept(WiFiUDP * exC);
108109

109110
};
110111

0 commit comments

Comments
 (0)