Skip to content
Snippets Groups Projects
Commit feb6de4c authored by Robin Mueller's avatar Robin Mueller
Browse files

hook functions for global config and

command preparations
parent cec4be40
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,7 @@ import struct ...@@ -11,6 +11,7 @@ import struct
import pprint import pprint
from typing import Tuple from typing import Tuple
import logging import logging
from obsw_user_code import global_setup_hook
""" """
Global service_type definitions Global service_type definitions
...@@ -166,4 +167,5 @@ def set_globals(args): ...@@ -166,4 +167,5 @@ def set_globals(args):
G_PRINT_RAW_TM = args.rawDataPrint G_PRINT_RAW_TM = args.rawDataPrint
G_COM_PORT = args.com_port G_COM_PORT = args.com_port
G_TM_TIMEOUT = args.tm_timeout G_TM_TIMEOUT = args.tm_timeout
global_setup_hook()
...@@ -60,11 +60,15 @@ import unittest ...@@ -60,11 +60,15 @@ import unittest
import logging import logging
import sys import sys
from collections import deque from collections import deque
from typing import Tuple, Union
from test import obsw_pus_service_test from test import obsw_pus_service_test
from config import obsw_config as g from config import obsw_config as g
from config.obsw_config import set_globals from config.obsw_config import set_globals
from tc.obsw_pus_tc_packer import PusTelecommand, create_total_tc_queue, pack_service_queue from tc.obsw_pus_tc_packer import PusTelecommand, create_total_tc_queue, pack_service_queue
from tc.obsw_pus_tc_frame_packer import pack_tc_frame
from obsw_user_code import command_preparation_hook
from tc.obsw_pus_tc_base import PusTcInfo
from sendreceive.obsw_single_command_sender_receiver import SingleCommandSenderReceiver from sendreceive.obsw_single_command_sender_receiver import SingleCommandSenderReceiver
from sendreceive.obsw_sequential_sender_receiver import SequentialCommandSenderReceiver from sendreceive.obsw_sequential_sender_receiver import SequentialCommandSenderReceiver
...@@ -120,15 +124,12 @@ def main(): ...@@ -120,15 +124,12 @@ def main():
pass pass
def command_preparation(): def command_preparation() -> Tuple[bytearray, Union[None, PusTcInfo]]:
""" """
Prepare command for single command testing Prepare command for single command testing
:return: :return:
""" """
# Direct command which triggers an additional step reply and one completion reply return command_preparation_hook()
# Single Command Testing
command = PusTelecommand(service=17, subservice=1, ssc=21)
return command.pack_command_tuple()
class TmTcHandler: class TmTcHandler:
......
"""
User defined code can be added here.
"""
from typing import Tuple, Union
from tc.obsw_pus_tc_base import PusTcInfo
def command_preparation_hook() -> Tuple[bytearray, Union[None, PusTcInfo]]:
"""
Can be used to pack user-defined commands.
"""
pass
def global_setup_hook():
"""
Can be used to alter the global variables in a custom defined way.
"""
pass
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment