AceTime  0.3
Date and time classes for Arduino that support timezones from the TZ Database, and a system clock that can synchronize from an NTP server or an RTC chip.
Public Member Functions | List of all members
ace_time::clock::SystemClockSyncLoop Class Reference

A class that periodically that syncs the SystemClock with its syncTimeProvider. More...

#include <SystemClockSyncLoop.h>

Public Member Functions

 SystemClockSyncLoop (SystemClock &systemClock, uint16_t syncPeriodSeconds=3600, uint16_t initialSyncPeriodSeconds=5, uint16_t requestTimeoutMillis=1000)
 Constructor. More...
 
void loop ()
 If AceRoutine coroutine infrastructure is not used, then call this from the global loop() method.
 
uint16_t getSecondsSinceLastSync () const
 Return the number of seconds since last sync. More...
 

Detailed Description

A class that periodically that syncs the SystemClock with its syncTimeProvider.

Definition at line 14 of file SystemClockSyncLoop.h.

Constructor & Destructor Documentation

◆ SystemClockSyncLoop()

ace_time::clock::SystemClockSyncLoop::SystemClockSyncLoop ( SystemClock systemClock,
uint16_t  syncPeriodSeconds = 3600,
uint16_t  initialSyncPeriodSeconds = 5,
uint16_t  requestTimeoutMillis = 1000 
)
inline

Constructor.

Parameters
systemClockthe system time keeper to sync up
syncPeriodSecondsseconds between normal sync attempts (default 3600)
initialSyncPeriodSecondsseconds between sync attempts when the systemClock is not initialized (default 5)
requestTimeoutMillisnumber of milliseconds before the request to syncTimeProvider times out

Definition at line 27 of file SystemClockSyncLoop.h.

Member Function Documentation

◆ getSecondsSinceLastSync()

uint16_t ace_time::clock::SystemClockSyncLoop::getSecondsSinceLastSync ( ) const
inline

Return the number of seconds since last sync.

Mostly for debugging purposes.

Definition at line 71 of file SystemClockSyncLoop.h.


The documentation for this class was generated from the following file: