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 | Static Public Attributes | List of all members
ace_time::provider::TimeProvider Class Referenceabstract

Base class for objects that provide a source of time whose time cannot be changed by the end-user. More...

#include <TimeProvider.h>

Inheritance diagram for ace_time::provider::TimeProvider:
Inheritance graph
[legend]

Public Member Functions

virtual ~TimeProvider ()
 Virtual destructor. More...
 
virtual acetime_t getNow () const =0
 Return the number of seconds since the AceTime epoch (2000-01-01T00:00:00Z). More...
 
virtual void sendRequest () const
 Send a time request asynchronously. More...
 
virtual bool isResponseReady () const
 Return true if a response is ready. More...
 
virtual acetime_t readResponse () const
 Returns number of seconds since AceTime epoch (2000-01-01). More...
 

Static Public Attributes

static const acetime_t kInvalidSeconds = INT32_MAX
 

Detailed Description

Base class for objects that provide a source of time whose time cannot be changed by the end-user.

For example, an NTP client, or a GPS module.

Definition at line 14 of file TimeProvider.h.

Constructor & Destructor Documentation

virtual ace_time::provider::TimeProvider::~TimeProvider ( )
inlinevirtual

Virtual destructor.

Unused except in unit tests.

Definition at line 19 of file TimeProvider.h.

Member Function Documentation

virtual acetime_t ace_time::provider::TimeProvider::getNow ( ) const
pure virtual

Return the number of seconds since the AceTime epoch (2000-01-01T00:00:00Z).

Returns kInvalidSeconds if an error has occured.

Implemented in ace_time::provider::SystemTimeKeeper.

virtual bool ace_time::provider::TimeProvider::isResponseReady ( ) const
inlinevirtual

Return true if a response is ready.

Used by SystemTimeSyncCoroutine.

Definition at line 31 of file TimeProvider.h.

virtual acetime_t ace_time::provider::TimeProvider::readResponse ( ) const
inlinevirtual

Returns number of seconds since AceTime epoch (2000-01-01).

Return kInvalidSeconds if there is an error. Valid only if isResponseReady() returns true. Used by SystemTimeSyncCoroutine.

Definition at line 38 of file TimeProvider.h.

virtual void ace_time::provider::TimeProvider::sendRequest ( ) const
inlinevirtual

Send a time request asynchronously.

Used by SystemTimeSyncCoroutine.

Definition at line 28 of file TimeProvider.h.


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