blob: c9c2cc9d6a4f53f31b3f2d1f23ad865c90e1a7ce [file] [log] [blame]
// Copyright 2018 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.
@available(added=15)
library fuchsia.hardware.rtc;
using zx;
type Time = struct {
seconds uint8;
minutes uint8;
hours uint8;
day uint8;
month uint8;
year uint16;
};
@discoverable
open protocol Device {
/// Get the current RTC time.
/// If the driver detects that it does not have a valid time to report, then it will return an
/// `ZX_ERR_INTERNAL` error.
flexible Get() -> (struct {
rtc Time;
}) error zx.Status;
/// Set the RTC time.
/// If the RTC time is not valid, the driver will return an `ZX_ERR_OUT_OF_RANGE` error.
flexible Set(struct {
rtc Time;
}) -> (struct {
status zx.Status;
});
};
service Service {
device client_end:Device;
};