Skip to content

Commit 1723a89

Browse files
committed
Useful method to update time after dynamic NTP server change.
1 parent a9803d7 commit 1723a89

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

NTPClient.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,7 @@ void NTPClient::setRandomPort(unsigned int minValue, unsigned int maxValue) {
231231
randomSeed(analogRead(0));
232232
this->_port = random(minValue, maxValue);
233233
}
234+
235+
void NTPClient::setLastUpdate(unsigned long sec) {
236+
this->_lastUpdate = sec;
237+
}

NTPClient.h

+5
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,9 @@ class NTPClient {
138138
* Stops the underlying UDP client
139139
*/
140140
void end();
141+
142+
/**
143+
* Set the last update time
144+
*/
145+
void setLastUpdate(unsigned long sec);
141146
};

0 commit comments

Comments
 (0)