|
oveRTOS C++ API
C++20 RAII wrappers for the oveRTOS C API
|
C++ wrappers around the oveRTOS SNTP client API. More...
Classes | |
| struct | Config |
| SNTP client configuration with C++ defaults. More... | |
Functions | |
| Result< void > | sync (const Config &cfg={}) noexcept |
| Synchronize with an NTP time server. | |
| Result< int64_t > | get_offset_us () noexcept |
| Get the UTC offset from the last successful sync. | |
| Result< uint32_t > | get_utc () noexcept |
| Get current UTC time in seconds since Unix epoch. | |
C++ wrappers around the oveRTOS SNTP client API.
Synchronize with an NTP time server.
| [in] | cfg | Configuration (defaults: pool.ntp.org, 5s timeout). |
Result<void> on success; unexpected Error on failure (Error::NetDnsFail, Error::Timeout, …).
|
inlinenoexcept |
Get the UTC offset from the last successful sync.
unexpected(Error::NotSupported) if no sync has been performed yet.