added setPoolServerIP

This commit is contained in:
Rainer Fritz 2022-09-11 16:05:36 +02:00
parent 78d4237b3a
commit c4661d927c
2 changed files with 12 additions and 0 deletions

View File

@ -181,6 +181,11 @@ 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::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);

View File

@ -44,6 +44,13 @@ class NTPClient {
*/ */
void setPoolServerName(const char* poolServerName); void setPoolServerName(const char* poolServerName);
/**
* Set time server IP
*
* @param poolServerIP
*/
void setPoolServerIP(IPAddress poolServerIP);
/** /**
* Set random local port * Set random local port
*/ */