mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-27 18:02:17 +03:00
LEAmDNS Fixes 1.1 (#5619)
* Fixes 1.1 - Better separation of ESP wifi thread code from user thread code - Added a flag for 'update()'-less use (disabled by default) - The too fast updates for service queries are fixed - Switched fully to PolledTimeout; LEATimeFlag not needed anymore (BTW: a const 'expired()' method would be helpful) - The device should stay visible now even after the first TTL timeout - Improved service querying (queries five times now) * Update mDNS_Clock.ino Removed references to LEATimeFlag.h * Update mDNS_Clock.ino Styling
This commit is contained in:
@ -316,17 +316,14 @@ void loop(void) {
|
||||
MDNS.update();
|
||||
|
||||
// Update time (if needed)
|
||||
//static unsigned long ulNextTimeUpdate = UPDATE_CYCLE;
|
||||
static clsMDNSTimeFlag timeFlag(UPDATE_CYCLE);
|
||||
if (timeFlag.flagged()/*ulNextTimeUpdate < millis()*/) {
|
||||
static esp8266::polledTimeout::periodic timeout(UPDATE_CYCLE);
|
||||
if (timeout.expired()) {
|
||||
|
||||
if (hMDNSService) {
|
||||
// Just trigger a new MDNS announcement, this will lead to a call to
|
||||
// 'MDNSDynamicServiceTxtCallback', which will update the time TXT item
|
||||
MDNS.announce();
|
||||
}
|
||||
//ulNextTimeUpdate = (millis() + UPDATE_CYCLE); // Set update 'timer'
|
||||
timeFlag.restart();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user