-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Nick Spinale <nick@nickspinale.com>
- Loading branch information
Showing
6 changed files
with
72 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
crates/examples/microkit/http-server/pds/server/src/rtc_client.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// Copyright 2023, Colias Group, LLC | ||
// | ||
// SPDX-License-Identifier: BSD-2-Clause | ||
// | ||
|
||
use sel4_microkit::MessageInfo; | ||
use sel4_microkit_message::MessageInfoExt as _; | ||
|
||
use microkit_http_server_example_pl031_driver_interface_types::*; | ||
|
||
pub struct RTCClient { | ||
channel: sel4_microkit::Channel, | ||
} | ||
|
||
impl RTCClient { | ||
pub fn new(channel: sel4_microkit::Channel) -> Self { | ||
Self { channel } | ||
} | ||
|
||
pub fn now(&self) -> Seconds { | ||
let req = Request::Now; | ||
let resp: NowResponse = self | ||
.channel | ||
.pp_call(MessageInfo::send_using_postcard(req).unwrap()) | ||
.recv_using_postcard() | ||
.unwrap(); | ||
resp.unix_time | ||
} | ||
} |