NTPClient icon indicating copy to clipboard operation
NTPClient copied to clipboard

New Return Value to Distinguish "Non-update" from Successful Update

Open bitsy opened this issue 6 years ago • 1 comments

Currently, update() returns false only when an update fails during the call to forceUpdate(). This behavior is potentially useful for debugging. However, two other things can happen during update(): a successful update and a "non-update" (when update() does not call forceUpdate() because the _updateInterval requirement has not been met). However, no distinction exists between a successful update and a non-update—both situations return true. Users have expressed interest in knowing whether are not a successful update has actually occurred (see Issue #55).

That being the case, I propose revising update() and forceUpdate() to return an 8-bit unsigned integer value rather than a boolean so that a failed update returns 0, a “non-update” returns 1, and a successful update returns 2. It maintains the current boolean behavior to avoid breaking other people’s implementations of the library yet also returns distinct values for both successful updates and non-updates.

bitsy avatar Sep 17 '19 22:09 bitsy

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 09 '21 13:04 CLAassistant