TinyCTS
Bluetooth Current Time Service client and server for Arduino
Loading...
Searching...
No Matches
tiny_cts::TinyCTSSystemSource Class Reference

The UTC time of the system clock (gettimeofday()). Not available on the boards without gettimeofday() (AVR, Uno R4). Times before minValidSeconds (default 2023-11-14) are treated as "clock not set". More...

#include <TinyCTSTimeSource.h>

Inheritance diagram for tiny_cts::TinyCTSSystemSource:
tiny_cts::TinyCTSTimeSource

Public Member Functions

 TinyCTSSystemSource (uint32_t minValidSeconds=1700000000UL)
uint64_t getTimeMs () override
 The current UTC time in milliseconds since 1970-01-01. It must not block.
bool setTimeMs (uint64_t unixMs) override

Protected Attributes

uint32_t _minValid

Detailed Description

The UTC time of the system clock (gettimeofday()). Not available on the boards without gettimeofday() (AVR, Uno R4). Times before minValidSeconds (default 2023-11-14) are treated as "clock not set".

Member Function Documentation

◆ getTimeMs()

uint64_t tiny_cts::TinyCTSSystemSource::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.

◆ setTimeMs()

bool tiny_cts::TinyCTSSystemSource::setTimeMs ( uint64_t unixMs)
inlineoverridevirtual

Sets the system clock: needs the rights (root) on the desktop. Not on Windows.

Reimplemented from tiny_cts::TinyCTSTimeSource.


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