Add end() API

This commit is contained in:
Sandeep Mistry 2016-04-12 10:45:21 -04:00
parent 3c1d6b1c18
commit ab5d7ac9f8
3 changed files with 10 additions and 0 deletions

View File

@ -119,6 +119,10 @@ String NTPClient::getFormattedTime() {
return hoursStr + ":" + minuteStr + ":" + secondStr; return hoursStr + ":" + minuteStr + ":" + secondStr;
} }
void NTPClient::end() {
this->_udp->stop();
}
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

@ -56,4 +56,9 @@ class NTPClient {
* @return time as raw seconds * @return time as raw seconds
*/ */
unsigned long getRawTime(); unsigned long getRawTime();
/**
* Stops the underlying UDP client
*/
void end();
}; };

View File

@ -9,6 +9,7 @@ NTPClient KEYWORD1
####################################### #######################################
begin KEYWORD2 begin KEYWORD2
end KEYWORD2
update KEYWORD2 update KEYWORD2
forceUpdate KEYWORD2 forceUpdate KEYWORD2
getDay KEYWORD2 getDay KEYWORD2