AceTime  0.1
Date and time classes for Arduino that supports the TZ DAtabase, and a system clock synchronized from an NTP server or an RTC chip.
Public Member Functions | List of all members
ace_time::provider::SystemTimeSyncLoop Class Reference

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

#include <SystemTimeSyncLoop.h>

Public Member Functions

 SystemTimeSyncLoop (SystemTimeKeeper &systemTimeKeeper, 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 SystemTimeKeeper with its syncTimeProvider.

Definition at line 14 of file SystemTimeSyncLoop.h.

Constructor & Destructor Documentation

ace_time::provider::SystemTimeSyncLoop::SystemTimeSyncLoop ( SystemTimeKeeper systemTimeKeeper,
uint16_t  syncPeriodSeconds = 3600,
uint16_t  initialSyncPeriodSeconds = 5,
uint16_t  requestTimeoutMillis = 1000 
)
inline

Constructor.

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

Definition at line 27 of file SystemTimeSyncLoop.h.

Member Function Documentation

uint16_t ace_time::provider::SystemTimeSyncLoop::getSecondsSinceLastSync ( ) const
inline

Return the number of seconds since last sync.

Mostly for debugging purposes.

Definition at line 71 of file SystemTimeSyncLoop.h.


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