TinyCTS
Bluetooth Current Time Service client and server for Arduino
Loading...
Searching...
No Matches
tiny_cts::TinyCTSSourceAdapter< T > Class Template Reference

Uses any object with a getTimeMs() method as time source, e.g. the TinyNTPClient of the TinyNTP library: More...

#include <TinyCTSTimeSource.h>

Inheritance diagram for tiny_cts::TinyCTSSourceAdapter< T >:
tiny_cts::TinyCTSTimeSource

Public Member Functions

 TinyCTSSourceAdapter (T &source)
uint64_t getTimeMs () override
 The current UTC time in milliseconds since 1970-01-01. It must not block.
Public Member Functions inherited from tiny_cts::TinyCTSTimeSource
virtual bool setTimeMs (uint64_t unixMs)
 Set the current UTC time, e.g. when a client writes the Current Time characteristic. The default implementation does not support this.

Protected Attributes

T & _source

Detailed Description

template<typename T>
class tiny_cts::TinyCTSSourceAdapter< T >

Uses any object with a getTimeMs() method as time source, e.g. the TinyNTPClient of the TinyNTP library:

TinyNTPClient<WiFiUDP> ntp;
TinyCTSSourceAdapter<TinyNTPClient<WiFiUDP>> source(ntp);

Member Function Documentation

◆ getTimeMs()

template<typename T>
uint64_t tiny_cts::TinyCTSSourceAdapter< T >::getTimeMs ( )
inlineoverridevirtual

The current UTC time in milliseconds since 1970-01-01. It must not block.

Returns
The time or 0 as long as it is not known.

Implements tiny_cts::TinyCTSTimeSource.


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