Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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