Skip to main content

Module clock_sync

Module clock_sync 

Source
Expand description

A device abstraction that combines NTP time synchronization with a local clock.

This module provides platform-independent types and logic for ClockSync and a concrete runtime implementation re-exported by platform crates. For a complete usage example see the platform crate’s clock_sync module (for example device_envoy_rp::clock_sync or device_envoy_esp::clock_sync).

The shared trait, time types, constants, and helpers are available on every platform. The NTP-backed runtime implementation is enabled by the wifi feature.

Structs§

ClockSyncTick
Tick event emitted by ClockSync.
UnixSeconds
Units-safe wrapper for Unix timestamps (seconds since 1970-01-01 00:00:00 UTC).

Constants§

ONE_DAY
Duration representing one day (24 hours).
ONE_MINUTE
Duration representing one minute (60 seconds).
ONE_SECOND
Duration representing one second.

Traits§

ClockSync
Platform-agnostic ClockSync operation contract.

Functions§

h12_m_s
Extract hour (12-hour format), minute, and second from an OffsetDateTime.