Skip to content

Commit

Permalink
Update NTPClient.cpp
Browse files Browse the repository at this point in the history
The NTPClient method update() has been changed to only return "TRUE" after a successful update. The following conditions return "FALSE":
- Interval duration requirement not met
- forceUpdate() times out
  • Loading branch information
bitsy committed Sep 17, 2018
1 parent 020aaf8 commit 712c58c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions NTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ bool NTPClient::forceUpdate() {

this->_currentEpoc = secsSince1900 - SEVENZYYEARS;

return true;
return true; // return true after successful update
}

bool NTPClient::update() {
Expand All @@ -98,7 +98,7 @@ bool NTPClient::update() {
if (!this->_udpSetup) this->begin(); // setup the UDP client if needed
return this->forceUpdate();
}
return true;
return false; // return false if update does not occur
}

unsigned long NTPClient::getEpochTime() const {
Expand Down

0 comments on commit 712c58c

Please sign in to comment.