Skip to content

Commit 92e5a5c

Browse files
committed
MGS: Finish extracting SP communications to its own crate
1 parent 4a81672 commit 92e5a5c

File tree

17 files changed

+1486
-1105
lines changed

17 files changed

+1486
-1105
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gateway-messages/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ pub struct IgnitionState {
129129
pub flags: IgnitionFlags,
130130
}
131131

132+
impl IgnitionState {
133+
pub fn is_powered_on(self) -> bool {
134+
self.flags.intersects(IgnitionFlags::POWER)
135+
}
136+
}
137+
132138
bitflags! {
133139
#[derive(Default, SerializedSize, Serialize, Deserialize)]
134140
pub struct IgnitionFlags: u8 {
@@ -305,6 +311,7 @@ impl fmt::Debug for SpComponent {
305311

306312
/// Error type returned from `TryFrom<&str> for SpComponent` if the provided ID
307313
/// is too long.
314+
#[derive(Debug)]
308315
pub struct SpComponentIdTooLong;
309316

310317
impl TryFrom<&str> for SpComponent {

gateway-sp-comms/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ version = "1.16"
2222
features = [ "full" ]
2323

2424
[dev-dependencies]
25+
once_cell = "1.9"
2526
omicron-test-utils = { path = "../test-utils" }

0 commit comments

Comments
 (0)