| // Copyright 2019 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| library fuchsia.time; |
| using zx; |
| |
| /// Metadata about a device's approximation of UTC time, commonly referred to as "system time." |
| [Discoverable] |
| protocol Utc { |
| /// Notifies clients of updates to the UTC timeline. The first call on a channel returns |
| /// immediately, and subsequent calls on the same channel will return when the state |
| /// has changed. |
| WatchState() -> (UtcState state); |
| }; |
| |
| /// Describes the state of the clock. |
| table UtcState { |
| /// The monotonic time at which this `UtcState` was observed. |
| 1: zx.time timestamp; |
| /// The source of our current UTC approximation. |
| 2: UtcSource source; |
| }; |
| |
| /// Describes the source from which the current UTC approximation was retrieved. |
| enum UtcSource { |
| /// The clock has been initialized to a known-prior reference time but may be highly inaccurate. |
| BACKSTOP = 2; |
| /// The clock has been initialized from a suitably accurate external time source. For many |
| /// devices the most common external time source is a network time server. |
| EXTERNAL = 3; |
| }; |