From 1007ede844ec9e499c6dac69067f23232c63350d Mon Sep 17 00:00:00 2001
From: "Robin.Mueller" <robin.mueller.m@gmail.com>
Date: Sat, 28 Nov 2020 00:58:08 +0100
Subject: [PATCH] additional getter/setters

---
 config/obsw_config.py    | 8 ++++++++
 core/tmtc_client_core.py | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/config/obsw_config.py b/config/obsw_config.py
index 9b47d40..99955e7 100644
--- a/config/obsw_config.py
+++ b/config/obsw_config.py
@@ -199,3 +199,11 @@ def get_glob_com_if():
     global G_COM_IF
     return G_COM_IF
 
+def set_glob_mode(new_mode : ModeList):
+    global G_MODE_ID
+    G_MODE_ID = new_mode
+
+def get_glob_mode():
+    global G_MODE_ID
+    return G_MODE_ID
+
diff --git a/core/tmtc_client_core.py b/core/tmtc_client_core.py
index bbf060f..3508f4e 100755
--- a/core/tmtc_client_core.py
+++ b/core/tmtc_client_core.py
@@ -46,7 +46,7 @@ def run_tmtc_client(use_gui: bool, reduced_printout: bool = False):
 
     if not use_gui:
         # The global variables are set by the argument parser.
-        tmtc_handler = TmTcHandler(g.G_COM_IF, g.G_MODE_ID)
+        tmtc_handler = TmTcHandler(g.get_glob_com_if(), g.get_glob_mode())
         tmtc_handler.set_one_shot_or_loop_handling(g.G_LISTENER_AFTER_OP)
         tmtc_handler.initialize()
         tmtc_handler.start()
-- 
GitLab