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); 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