8000 LEAmDNS Fixes 1.1 by LaborEtArs · Pull Request #5619 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

LEAmDNS Fixes 1.1 #5619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 18, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update mDNS_Clock.ino
Removed references to LEATimeFlag.h
  • Loading branch information
LaborEtArs committed Jan 15, 2019
commit a070d948b18c517b305ed5dcdc05f9f97155e879
16 changes: 8 additions & 8 deletions libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,13 @@ bool MDNSProbeResultCallback(MDNSResponder* p_pMDNSResponder,
}
}
}
} else {
}
else {
// Change hostname, use '-' as divider between base name and index
if (MDNSResponder::indexDomain(pcHostDomain, "-", 0)) {
p_pMDNSResponder->setHostname(pcHostDomain);
} else {
}
else {
Serial.println("MDNSProbeResultCallback: FAILED to update hostname!");
}
}
Expand Down Expand Up @@ -249,7 +251,8 @@ void handleHTTPClient(WiFiClient& client) {
// done :-)
s += "</html>\r\n\r\n";
Serial.println("Sending 200");
} else {
}
else {
s = "HTTP/1.1 404 Not Found\r\n\r\n";
Serial.println("Sending 404");
}
Expand Down Expand Up @@ -316,17 +319,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();
}
}

Expand Down
0