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

todo added

parent 00b7b9a3
Branches
No related tags found
No related merge requests found
...@@ -183,3 +183,19 @@ def set_globals(args): ...@@ -183,3 +183,19 @@ def set_globals(args):
from config.obsw_user_code import global_setup_hook from config.obsw_user_code import global_setup_hook
global_setup_hook() global_setup_hook()
def set_glob_apid(new_apid: int):
global G_APID
G_APID = new_apid
def get_glob_apid():
global G_APID
return G_APID
def set_glob_com_if(new_com_if: ComInterfaces):
global G_COM_IF
G_COM_IF = new_com_if
def get_glob_com_if():
global G_COM_IF
return G_COM_IF
...@@ -3,10 +3,13 @@ User defined code can be added here. ...@@ -3,10 +3,13 @@ User defined code can be added here.
""" """
from typing import Union, Tuple from typing import Union, Tuple
from tmtc_core.tc.obsw_pus_tc_base import PusTcInfo from tmtc_core.tc.obsw_pus_tc_base import PusTcInfo
from tmtc_core.tmtc_core_definitions import ComInterfaces
from enum import Enum from enum import Enum
# Yeah, I did not have a better idea yet.. # TODO: We really need that JSON file which will not be tracked by version control.
# In that JSON file, we could set the current developer, so that developers can
# hook into the config.
class Developer(Enum): class Developer(Enum):
Robin = 0 Robin = 0
...@@ -22,24 +25,24 @@ def command_preparation_hook() -> Tuple[bytearray, Union[None, PusTcInfo]]: ...@@ -22,24 +25,24 @@ def command_preparation_hook() -> Tuple[bytearray, Union[None, PusTcInfo]]:
return prepare_robins_commands() return prepare_robins_commands()
def prepare_robins_commands():
from tmtc_core.tc.obsw_pus_tc_base import PusTelecommand
command = PusTelecommand(service=17, subservice=1, ssc=20)
return command.pack_command_tuple()
def global_setup_hook(): def global_setup_hook():
""" """
Can be used to alter the global variables in a custom defined way. Can be used to alter the global variables in a custom defined way.
For example, device specific com ports or ethernet ports can be set here. For example, device specific com ports or ethernet ports can be set here.
The global variables in the config.obsw_config file can be edited here The global variables in the config.obsw_config file can be edited here
by using the handle. by using the handle.
For example: config.obsw_config.G_ETHERNET_SEND_ADDRESS = new_send_address
""" """
if Developer == Developer.Robin: if Developer == Developer.Robin:
global_setup_hook_robin() global_setup_hook_robin()
def prepare_robins_commands():
from tmtc_core.tc.obsw_pus_tc_base import PusTelecommand
command = PusTelecommand(service=17, subservice=1, ssc=20)
return command.pack_command_tuple()
def global_setup_hook_robin(): def global_setup_hook_robin():
import config.obsw_config from config.obsw_config import get_glob_com_if, set_glob_apid
pass if get_glob_com_if() == ComInterfaces.Ethernet:
# Configure APID for FSFW example. Set this back to 0x73 for STM32!
set_glob_apid(0xEF)
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
@author R. Mueller @author R. Mueller
@date 02.05.2020 @date 02.05.2020
""" """
import config.obsw_config as g
from tc.obsw_pus_tc_packer import TcQueueT, PusTelecommand from tc.obsw_pus_tc_packer import TcQueueT, PusTelecommand
......
Subproject commit db6aaef2824f19cfc3687ae63ec5480aeb0e4cb2 Subproject commit 440b94ce454f50d4078962806ef03942f56d466c
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment