|
TinyCTS
Bluetooth Current Time Service client and server for Arduino
|
A software clock: you set the UTC time (from an RTC, a GPS, ...) and it keeps counting with millis(). The time is 0 (not known) until it is set. Read or set it at least once every 49 days (overflow of millis()). More...
#include <TinyCTSTimeSource.h>
Public Member Functions | |
| void | clear () |
| uint64_t | getTimeMs () override |
| The current UTC time in milliseconds since 1970-01-01. It must not block. | |
| bool | isSet () const |
| void | setTime (uint32_t unixSeconds, uint16_t milliseconds=0) |
| bool | setTimeMs (uint64_t unixMs) override |
| Set the current UTC time, e.g. when a client writes the Current Time characteristic. The default implementation does not support this. | |
Protected Attributes | |
| uint32_t | _lastMillis = 0 |
| uint64_t | _timeMs = 0 |
A software clock: you set the UTC time (from an RTC, a GPS, ...) and it keeps counting with millis(). The time is 0 (not known) until it is set. Read or set it at least once every 49 days (overflow of millis()).
|
inlineoverridevirtual |
The current UTC time in milliseconds since 1970-01-01. It must not block.
Implements tiny_cts::TinyCTSTimeSource.
|
inlineoverridevirtual |
Set the current UTC time, e.g. when a client writes the Current Time characteristic. The default implementation does not support this.
Reimplemented from tiny_cts::TinyCTSTimeSource.