diff --git a/config/obsw_config.py b/config/obsw_config.py index c1da8d42885281c25f0c98d8a2128b97a33a71c2..e6edf5751fac6de88a582a4020ac32316b790608 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 d44712e518742b697cfc1271c917952e388a0eda..0783c220daf0b61d4e65cff52059458570b8ff07 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 0000000000000000000000000000000000000000..d7abcabba2693997e4bdbeea25c8a444832b2534 --- /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 0000000000000000000000000000000000000000..c59508eb8d82f330014136d974162128490be9d0 --- /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 0000000000000000000000000000000000000000..f507f12ae52bb5518d692c9b2f461c78c7295ca5 --- /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) +""" +