add setPoolServerIP and setPoolServerAddress methods

This commit is contained in:
Christophe Catherine Slychan 2020-04-26 23:36:44 +02:00 committed by GitHub
parent 0c2ba5e652
commit 8327b23f3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -177,6 +177,20 @@ void NTPClient::setPoolServerName(const char* poolServerName) {
this->_poolServerName = 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() { void NTPClient::sendNTPPacket() {
// set all bytes in the buffer to 0 // set all bytes in the buffer to 0
memset(this->_packetBuffer, 0, NTP_PACKET_SIZE); memset(this->_packetBuffer, 0, NTP_PACKET_SIZE);