From 314a3cc0c37e4f4143ee037db9a941efc3fb06dc Mon Sep 17 00:00:00 2001
From: "Robin.Mueller" <robin.mueller.m@gmail.com>
Date: Tue, 18 Aug 2020 01:52:36 +0200
Subject: [PATCH] added stubs

---
 config/obsw_config.py           |  3 ++-
 obsw_tmtc_client.py             |  5 +++++
 utility/dle_encoder.py          | 10 ++++++++++
 utility/hammingcode.py          |  9 +++++++++
 utility/obsw_binary_uploader.py |  9 +++++++++
 5 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 utility/dle_encoder.py
 create mode 100644 utility/hammingcode.py
 create mode 100644 utility/obsw_binary_uploader.py

diff --git a/config/obsw_config.py b/config/obsw_config.py
index c1da8d4..e6edf57 100644
--- a/config/obsw_config.py
+++ b/config/obsw_config.py
@@ -25,7 +25,8 @@ class ModeList(enum.Enum):
     SingleCommandMode = 2
     ServiceTestMode = 3
     SoftwareTestMode = 4
-    UnitTest = 5
+    BinaryUploadMode = 5
+    UnitTest = 6
 
 
 class ComIF(enum.Enum):
diff --git a/obsw_tmtc_client.py b/obsw_tmtc_client.py
index d44712e..0783c22 100755
--- a/obsw_tmtc_client.py
+++ b/obsw_tmtc_client.py
@@ -211,6 +211,11 @@ class TmTcHandler:
             suite = unittest.TestLoader().loadTestsFromModule(obsw_pus_service_test)
             unittest.TextTestRunner(verbosity=2).run(suite)
 
+        elif self.mode == g.ModeList.BinaryUploadMode:
+            # Upload binary, prompt user for input, in the end prompt for new mode and enter that
+            # mode
+
+            self.command_received = True
         else:
             logging.error("Unknown Mode, Configuration error !")
             sys.exit()
diff --git a/utility/dle_encoder.py b/utility/dle_encoder.py
new file mode 100644
index 0000000..d7abcab
--- /dev/null
+++ b/utility/dle_encoder.py
@@ -0,0 +1,10 @@
+"""
+@brief      DLE Encoder Implementation
+@details
+DLE encoding can be used to provide a simple transport layer for serial data.
+A give data stream is encoded by adding a STX char at the beginning and an ETX char at the end.
+All STX and ETX occurences in the packet are encoded as well so the receiver can simply look
+for STX and ETX occurences to identify packets.
+"""
+
+# TODO: Implementation / Translation of C code
diff --git a/utility/hammingcode.py b/utility/hammingcode.py
new file mode 100644
index 0000000..c59508e
--- /dev/null
+++ b/utility/hammingcode.py
@@ -0,0 +1,9 @@
+"""
+@brief      Hamming Code Implementation
+@details
+Hamming codes belong to the family of linear error correcting codes.
+Documentation: https://en.wikipedia.org/wiki/Hamming_code
+They can be used to identify up to two bit error and correct on bit error.
+"""
+
+# TODO: Implementation / Translation of C code
diff --git a/utility/obsw_binary_uploader.py b/utility/obsw_binary_uploader.py
new file mode 100644
index 0000000..f507f12
--- /dev/null
+++ b/utility/obsw_binary_uploader.py
@@ -0,0 +1,9 @@
+#!/usr/bin/python3.8
+"""
+@brief      Binary Uploader Module
+@details
+This module will be used to upload binaries to the OBC via a communication port, given
+a supplied binary. The binary will be sent via the specified communication interface.
+It will be possible to encode the data (for example using DLE encoding)
+"""
+
-- 
GitLab