mirror of
https://github.com/lumapu/ahoy.git
synced 2025-07-09 12:37:17 +02:00
added comments and cleanup
This commit is contained in:
parent
84f21f441b
commit
384ee6ea7f
1 changed files with 5 additions and 0 deletions
|
@ -72,6 +72,8 @@ class AhoyNetwork {
|
||||||
|
|
||||||
ip_addr_t ipaddr;
|
ip_addr_t ipaddr;
|
||||||
mNtpIp = WiFi.gatewayIP();
|
mNtpIp = WiFi.gatewayIP();
|
||||||
|
// dns_gethostbyname runs asynchronous and sets the member mNtpIp which is then checked on
|
||||||
|
// next call of updateNtpTime
|
||||||
err_t err = dns_gethostbyname(mConfig->ntp.addr, &ipaddr, dnsCallback, this);
|
err_t err = dns_gethostbyname(mConfig->ntp.addr, &ipaddr, dnsCallback, this);
|
||||||
|
|
||||||
if (err == ERR_OK) {
|
if (err == ERR_OK) {
|
||||||
|
@ -92,6 +94,9 @@ class AhoyNetwork {
|
||||||
this->handleNTPPacket(packet);
|
this->handleNTPPacket(packet);
|
||||||
});
|
});
|
||||||
sendNTPpacket();
|
sendNTPpacket();
|
||||||
|
|
||||||
|
// reset to start with DNS lookup next time again
|
||||||
|
mNtpIp = IPAddress(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue