From 260ec364e2fa674db1d5a03e07f8d688f2ea2576 Mon Sep 17 00:00:00 2001 From: lkoester Date: Thu, 16 Feb 2023 15:43:10 +0100 Subject: [PATCH 1/2] added getter fuctions to modecommand --- satrs-core/src/mode.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/satrs-core/src/mode.rs b/satrs-core/src/mode.rs index c07a030..3972a8b 100644 --- a/satrs-core/src/mode.rs +++ b/satrs-core/src/mode.rs @@ -50,6 +50,22 @@ impl ModeCommand { mode_submode, } } + + pub fn address(&self) -> TargetId { + self.address + } + + pub fn mode_submode(&self) -> ModeAndSubmode { + self.mode_submode + } + + pub fn get_mode(&self) -> u32 { + self.mode_submode.mode + } + + pub fn get_submode(&self) -> u16 { + self.mode_submode.submode + } } #[derive(Debug, Copy, Clone, PartialEq, Eq)] -- 2.43.0 From 8a025c84b138c77ea5c8ee3604e8fb16f3182c42 Mon Sep 17 00:00:00 2001 From: lkoester Date: Thu, 16 Feb 2023 16:37:28 +0100 Subject: [PATCH 2/2] changed name convention --- 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 3972a8b..1ebd854 100644 --- a/satrs-core/src/mode.rs +++ b/satrs-core/src/mode.rs @@ -59,11 +59,11 @@ impl ModeCommand { self.mode_submode } - pub fn get_mode(&self) -> u32 { + pub fn mode(&self) -> u32 { self.mode_submode.mode } - pub fn get_submode(&self) -> u16 { + pub fn submode(&self) -> u16 { self.mode_submode.submode } } -- 2.43.0