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 86934b2482d5f2348ff0cc5e3fb200ba484abe0a..27a6d6a8e61fce6b1562c2416be7f6853e157362 100755 --- a/obsw_tmtc_client.py +++ b/obsw_tmtc_client.py @@ -212,6 +212,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) +""" + diff --git a/utility/obsw_logger.py b/utility/obsw_logger.py index 5725183b29e914234b7b73a67fb7ea06189186aa..736a656a80676c0e2d32a7a41da95d6464e2d87c 100644 --- a/utility/obsw_logger.py +++ b/utility/obsw_logger.py @@ -72,6 +72,7 @@ def set_tmtc_logger() -> logging.Logger: logger.addHandler(console_error_handler) return logger + def get_logger() -> logging.Logger: """ Get the global logger instance.