From 0c2ba5e652d53803c65067c89c61270f4a75989d Mon Sep 17 00:00:00 2001 From: Christophe Catherine Slychan Date: Sun, 26 Apr 2020 23:34:28 +0200 Subject: [PATCH 1/2] add headers for new methods --- NTPClient.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/NTPClient.h b/NTPClient.h index 20ec43b..e8fbf33 100755 --- a/NTPClient.h +++ b/NTPClient.h @@ -43,6 +43,21 @@ class NTPClient { * @param poolServerName */ void setPoolServerName(const char* poolServerName); + + /** + * Set time server IP address + * + * @param poolServerIP + */ + void setPoolServerIP(IPAddress poolServerIP); + + /** + * Set time server domain or IP address + * + * @param poolServerAddress + */ + void setPoolServerAddress(const char* poolServerAddress); + void setPoolServerAddress(IPAddress poolServerAddress); /** * Starts the underlying UDP client with the default local port From 8327b23f3b65900f0a2dc6b6dc8ef1ad23742185 Mon Sep 17 00:00:00 2001 From: Christophe Catherine Slychan Date: Sun, 26 Apr 2020 23:36:44 +0200 Subject: [PATCH 2/2] add setPoolServerIP and setPoolServerAddress methods --- NTPClient.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/NTPClient.cpp b/NTPClient.cpp index fffe105..e052951 100755 --- a/NTPClient.cpp +++ b/NTPClient.cpp @@ -177,6 +177,20 @@ void NTPClient::setPoolServerName(const char* poolServerName) { this->_poolServerName = poolServerName; } +void NTPClient::setPoolServerIP(IPAddress poolServerIP) { + this->_poolServerIP = poolServerIP; + this->_poolServerName = NULL; +} + +void NTPClient::setPoolServerAddress(const char* poolServerAddress) { + this->_poolServerName = poolServerAddress; +} + +void NTPClient::setPoolServerAddress(IPAddress poolServerAddress) { + this->_poolServerIP = poolServerAddress; + this->_poolServerName = NULL; +} + void NTPClient::sendNTPPacket() { // set all bytes in the buffer to 0 memset(this->_packetBuffer, 0, NTP_PACKET_SIZE);