Skip to content

Commit 6bb8cda

Browse files
Peeter Normaksandeepmistry
Peeter Normak
authored andcommitted
added method for changing time server
1 parent 1012521 commit 6bb8cda

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

NTPClient.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ void NTPClient::setUpdateInterval(unsigned long updateInterval) {
148148
this->_updateInterval = updateInterval;
149149
}
150150

151+
void NTPClient::setPoolServerName(const char* poolServerName) {
152+
this->_poolServerName = poolServerName;
153+
}
154+
151155
void NTPClient::sendNTPPacket() {
152156
// set all bytes in the buffer to 0
153157
memset(this->_packetBuffer, 0, NTP_PACKET_SIZE);

NTPClient.h

+7
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ class NTPClient {
3333
NTPClient(UDP& udp, const char* poolServerName, long timeOffset);
3434
NTPClient(UDP& udp, const char* poolServerName, long timeOffset, unsigned long updateInterval);
3535

36+
/**
37+
* Set time server name
38+
*
39+
* @param poolServerName
40+
*/
41+
void setPoolServerName(const char* poolServerName);
42+
3643
/**
3744
* Starts the underlying UDP client with the default local port
3845
*/

0 commit comments

Comments
 (0)