added method for changing time server
This commit is contained in:
parent
10125217d9
commit
6bb8cdafc7
@ -148,6 +148,10 @@ void NTPClient::setUpdateInterval(unsigned long updateInterval) {
|
|||||||
this->_updateInterval = updateInterval;
|
this->_updateInterval = updateInterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NTPClient::setPoolServerName(const char* poolServerName) {
|
||||||
|
this->_poolServerName = poolServerName;
|
||||||
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
@ -33,6 +33,13 @@ class NTPClient {
|
|||||||
NTPClient(UDP& udp, const char* poolServerName, long timeOffset);
|
NTPClient(UDP& udp, const char* poolServerName, long timeOffset);
|
||||||
NTPClient(UDP& udp, const char* poolServerName, long timeOffset, unsigned long updateInterval);
|
NTPClient(UDP& udp, const char* poolServerName, long timeOffset, unsigned long updateInterval);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set time server name
|
||||||
|
*
|
||||||
|
* @param poolServerName
|
||||||
|
*/
|
||||||
|
void setPoolServerName(const char* poolServerName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts the underlying UDP client with the default local port
|
* Starts the underlying UDP client with the default local port
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user