From cf9b12b1dc325511703f1665cbc20648fed11578 Mon Sep 17 00:00:00 2001 From: lkoester Date: Tue, 28 Feb 2023 11:59:56 +0100 Subject: [PATCH 1/2] made mode elements public --- satrs-core/src/mode.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/satrs-core/src/mode.rs b/satrs-core/src/mode.rs index cdc23a4..2db06c9 100644 --- a/satrs-core/src/mode.rs +++ b/satrs-core/src/mode.rs @@ -39,8 +39,8 @@ impl ModeAndSubmode { #[derive(Debug, Copy, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct ModeCommand { - address: TargetId, - mode_submode: ModeAndSubmode, + pub address: TargetId, + pub mode_submode: ModeAndSubmode, } impl ModeCommand { From 153659bb88ea0b2f53753b85916e9c2c6953bfae Mon Sep 17 00:00:00 2001 From: lkoester Date: Tue, 28 Feb 2023 12:02:18 +0100 Subject: [PATCH 2/2] added getter to mode and submode --- satrs-core/src/mode.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/satrs-core/src/mode.rs b/satrs-core/src/mode.rs index 2db06c9..7155d67 100644 --- a/satrs-core/src/mode.rs +++ b/satrs-core/src/mode.rs @@ -35,6 +35,10 @@ impl ModeAndSubmode { submode: u16::from_be_bytes(buf[4..6].try_into().unwrap()), }) } + + pub fn mode(&self) -> u32 {self.mode} + + pub fn submode(&self) -> u16 {self.submode} } #[derive(Debug, Copy, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]