PaulStoffregen / Time

Time library for Arduino
http://playground.arduino.cc/code/time
1.25k stars 666 forks source link

Retry for Sync #9

Closed wayfarerbasta closed 9 years ago

wayfarerbasta commented 9 years ago

Hi Paul, thank you for the great Library. I'm using it with a Texas Instruments CC3200 Launchpad and Energia IDE. I have an issue with the setSyncProvider function. I'm using an NTP SyncProvider function. In the rare cases, when the NTP server fails to deliver the correct Unix Timestamp, the function returns the value 0. In this case I would expect that time will try to resync at least after the 300 s, the default value for SyncInterval. Unfortunatly is does not work. Further I would prefer to set a retry Interval in Cases of a sync failure. Do you have any advice for me

Tanks

wayfarerbasta

PaulStoffregen commented 9 years ago

Are you sure it really stops trying to sync if the return value is zero?

wayfarerbasta commented 9 years ago

Hi Paul, I double checked it and, I don't know why, but now it works. I just added an additional variable to your cpp to maintain the Sync interval and retry Sync interval seperately. Thank you.