You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This returns true when the time is not set - I feel that running waitSet means you want it to set the time, so it should return true if it succeeds instead.
Also - should there be a function to check if the time is set instead of calling waitSet or comparing the epoch to an integer in your own code? I was trying to check if NTP succeeded in my project as it's needed for my code to work - first I thought waitSet always returned false, then I was looking for another function to check for it, I ended up doing a comparison if time(nullptr) < 10000 which I feel is a bit janky instead of a library function call.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I just wanted to discuss how NTP.waitSet returns -
https://github.com/earlephilhower/arduino-pico/blob/master/libraries/WiFi/src/WiFiNTP.h#L94C17-L94C17
return time(nullptr) < 10000000;
This returns
true
when the time is not set - I feel that running waitSet means you want it to set the time, so it should return true if it succeeds instead.Also - should there be a function to check if the time is set instead of calling waitSet or comparing the epoch to an integer in your own code? I was trying to check if NTP succeeded in my project as it's needed for my code to work - first I thought waitSet always returned false, then I was looking for another function to check for it, I ended up doing a comparison if time(nullptr) < 10000 which I feel is a bit janky instead of a library function call.
all the best,
Cole
Beta Was this translation helpful? Give feedback.
All reactions