From d2161a6717a58d531ba38b3566bb4b9b6366e7b5 Mon Sep 17 00:00:00 2001 From: Tomas Jakstas Date: Sun, 22 Mar 2020 12:15:13 +0200 Subject: [PATCH] dns timeout is part of udp --- NTPClient.cpp | 6 +++--- NTPClient.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NTPClient.cpp b/NTPClient.cpp index 48a96ee..61a4115 100755 --- a/NTPClient.cpp +++ b/NTPClient.cpp @@ -92,7 +92,7 @@ bool NTPClient::forceUpdate(uint16_t timeout) { while(this->_udp->parsePacket() != 0) this->_udp->flush(); - this->sendNTPPacket(timeout >= 3000 ? 1500 : 500, 2); + this->sendNTPPacket(); // Wait till data is there or timeout... int cb = 0; @@ -177,7 +177,7 @@ void NTPClient::setPoolServerName(const char* poolServerName) { this->_poolServerName = poolServerName; } -void NTPClient::sendNTPPacket(uint16_t dnsTimeout, uint8_t dnsRetries) { +void NTPClient::sendNTPPacket() { // set all bytes in the buffer to 0 memset(this->_packetBuffer, 0, NTP_PACKET_SIZE); // Initialize values needed to form NTP request @@ -195,7 +195,7 @@ void NTPClient::sendNTPPacket(uint16_t dnsTimeout, uint8_t dnsRetries) { // all NTP fields have been given values, now // you can send a packet requesting a timestamp: if (this->_poolServerName) { - this->_udp->beginPacket(this->_poolServerName, 123, dnsTimeout, dnsRetries); + this->_udp->beginPacket(this->_poolServerName, 123); } else { this->_udp->beginPacket(this->_poolServerIP, 123); } diff --git a/NTPClient.h b/NTPClient.h index 22661f4..dc2c69b 100755 --- a/NTPClient.h +++ b/NTPClient.h @@ -25,7 +25,7 @@ class NTPClient { byte _packetBuffer[NTP_PACKET_SIZE]; - void sendNTPPacket(uint16_t dnsTimeout = 2000, uint8_t dnsRetries = 2); + void sendNTPPacket(); public: NTPClient(UDP& udp);