Skip to content

Commit

Permalink
MGS: Finish extracting SP communications to its own crate
Browse files Browse the repository at this point in the history
  • Loading branch information
jgallagher committed Mar 18, 2022
1 parent 4a81672 commit 92e5a5c
Show file tree
Hide file tree
Showing 17 changed files with 1,486 additions and 1,105 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions gateway-messages/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ pub struct IgnitionState {
pub flags: IgnitionFlags,
}

impl IgnitionState {
pub fn is_powered_on(self) -> bool {
self.flags.intersects(IgnitionFlags::POWER)
}
}

bitflags! {
#[derive(Default, SerializedSize, Serialize, Deserialize)]
pub struct IgnitionFlags: u8 {
Expand Down Expand Up @@ -305,6 +311,7 @@ impl fmt::Debug for SpComponent {

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

impl TryFrom<&str> for SpComponent {
Expand Down
1 change: 1 addition & 0 deletions gateway-sp-comms/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ version = "1.16"
features = [ "full" ]

[dev-dependencies]
once_cell = "1.9"
omicron-test-utils = { path = "../test-utils" }
Loading

0 comments on commit 92e5a5c

Please sign in to comment.