Replies: 3 comments
-
I think you're right that the return value is negated. We don't have a direct way of knowing SNTP has sent and gotten a response so we use the heuristic "it's sometime after 1981". While the "it's before 1981" is right for the busywait, the return value should be |
Beta Was this translation helpful? Give feedback.
0 replies
-
I've raised issue #2735 for this and PR on its way. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Closing as PR #2736 has been merged. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm trying to understand the bool return value from NTP.waitSet(). I initially thought that I'd get "true" if successfully set within the timeout period and "false" if timed out without syncing the time. I seem to be getting "false" even when successfully set.
I took a look at the source for the function in libraries/WiFi/src/WiFiNTP.h and the return value is provided by:
return time(nullptr) < 10000000;
It looks like the while loop exited before the timeout and with the time correctly set when time(nullptr) became no longer < 1000000, which causes the return value to be "false".
The docs say:
so I'm wondering if this is a bug. I'm happy to raise an issue/pull request for this if the consensus is that that's the case.
cheers,
Tim
Beta Was this translation helpful? Give feedback.
All reactions