diff --git a/eive_tmtc/pus_tc/devs/rtd.py b/eive_tmtc/pus_tc/devs/rtd.py index 450ced8..a97f277 100644 --- a/eive_tmtc/pus_tc/devs/rtd.py +++ b/eive_tmtc/pus_tc/devs/rtd.py @@ -1,4 +1,5 @@ from typing import Optional +import struct from eive_tmtc.config.definitions import CustomServiceList from eive_tmtc.pus_tc.devs.pdec_handler import CommandId @@ -32,18 +33,22 @@ RTD_IDS = [ ] +class CommandId: + WRITE_CONFIG = 6 + + class OpCode: ON = ["0", "on"] OFF = ["1", "off"] NORMAL = ["2", "normal"] - CONFIG_CMD = ["3", "Write config"] + WRITE_CONFIG = ["3", "Write config"] class Info: ON = "Switch handler on" OFF = "Switch handler off" NORMAL = "Switch handler normal" - WIRTE_CONFIG = "Write config" + WRITE_CONFIG = "Write config" @tmtc_definitions_provider @@ -52,6 +57,7 @@ def specify_rtd_cmds(defs: TmtcDefinitionWrapper): oce.add(keys=OpCode.ON, info=Info.ON) oce.add(keys=OpCode.NORMAL, info=Info.NORMAL) oce.add(keys=OpCode.OFF, info=Info.OFF) + oce.add(keys=OpCode.WRITE_CONFIG, info=Info.WRITE_CONFIG) defs.add_service( name=CustomServiceList.RTD.value, info="RTD commands", op_code_entry=oce ) @@ -92,8 +98,8 @@ def pack_rtd_commands( service=200, subservice=Subservice.TC_MODE_COMMAND, app_data=app_data ) ) - if op_code in OpCode.CONFIG_CMD: - command = object_id.as_bytes + CommandId.PRINT_CLCW + if op_code in OpCode.WRITE_CONFIG: + command = object_id.as_bytes + struct.pack("!I", CommandId.WRITE_CONFIG) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command)) diff --git a/eive_tmtc/tmtc/__init__.py b/eive_tmtc/tmtc/__init__.py index 22d3893..d78d994 100644 --- a/eive_tmtc/tmtc/__init__.py +++ b/eive_tmtc/tmtc/__init__.py @@ -1,2 +1,3 @@ from .payload.pl_subsystem import add_payload_subsystem_cmds +from .solar_array_deployment import add_sa_depl_cmds from .test import add_test_defs diff --git a/eive_tmtc/tmtc/acs/acs_ctrl.py b/eive_tmtc/tmtc/acs/acs_ctrl.py index 3e0c955..86efc20 100644 --- a/eive_tmtc/tmtc/acs/acs_ctrl.py +++ b/eive_tmtc/tmtc/acs/acs_ctrl.py @@ -258,7 +258,7 @@ def pack_acs_ctrl_command(p: ServiceProviderParams): elif op_code in OpCodes.ENABLE_RAW_GYR_HK: q.add_log_cmd(Info.ENABLE_RAW_GYR_HK) cmd_tuple = enable_periodic_hk_command_with_interval( - False, make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET), 2.0 + True, make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET), 2.0 ) q.add_pus_tc(cmd_tuple[0]) q.add_pus_tc(cmd_tuple[1]) @@ -266,7 +266,7 @@ def pack_acs_ctrl_command(p: ServiceProviderParams): q.add_log_cmd(Info.DISABLE_RAW_GYR_HK) q.add_pus_tc( disable_periodic_hk_command( - False, make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET) + True, make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET) ) ) elif op_code in OpCodes.REQUEST_PROC_GYR_HK: @@ -313,16 +313,14 @@ def pack_acs_ctrl_command(p: ServiceProviderParams): elif op_code in OpCodes.ENABLE_MEKF_HK: q.add_log_cmd(Info.ENABLE_MEKF_HK) cmd_tuple = enable_periodic_hk_command_with_interval( - False, make_sid(ACS_CONTROLLER, SetId.MEKF_DATA), 2.0 + True, make_sid(ACS_CONTROLLER, SetId.MEKF_DATA), 2.0 ) q.add_pus_tc(cmd_tuple[0]) q.add_pus_tc(cmd_tuple[1]) elif op_code in OpCodes.DISABLE_MEKF_HK: q.add_log_cmd(Info.DISABLE_MEKF_HK) q.add_pus_tc( - disable_periodic_hk_command( - False, make_sid(ACS_CONTROLLER, SetId.MEKF_DATA) - ) + disable_periodic_hk_command(True, make_sid(ACS_CONTROLLER, SetId.MEKF_DATA)) ) elif op_code in OpCodes.REQUEST_CTRL_VAL_HK: q.add_log_cmd(Info.REQUEST_CTRL_VAL_HK) diff --git a/eive_tmtc/tmtc/solar_array_deployment.py b/eive_tmtc/tmtc/solar_array_deployment.py index 7d8765d..f8f91b9 100644 --- a/eive_tmtc/tmtc/solar_array_deployment.py +++ b/eive_tmtc/tmtc/solar_array_deployment.py @@ -35,7 +35,7 @@ class ActionId: @tmtc_definitions_provider -def pack_sa_depl_cmds(defs: TmtcDefinitionWrapper): +def add_sa_depl_cmds(defs: TmtcDefinitionWrapper): oce = OpCodeEntry() oce.add(keys=OpCode.MANUAL_DEPLOYMENT, info=Info.MANUAL_DEPLOYMENT) defs.add_service( diff --git a/eive_tmtc/tmtc/test.py b/eive_tmtc/tmtc/test.py index 1a7985c..ad292fd 100644 --- a/eive_tmtc/tmtc/test.py +++ b/eive_tmtc/tmtc/test.py @@ -5,7 +5,7 @@ from tmtccmd.config.tmtc import ( TmtcDefinitionWrapper, OpCodeEntry, ) -from tmtccmd.pus.s17_test import pack_service_17_ping_command +from tmtccmd.pus.s17_test import create_service_17_ping_command from tmtccmd.tc import service_provider from tmtccmd.tc.decorator import ServiceProviderParams @@ -42,7 +42,7 @@ def pack_test_command(p: ServiceProviderParams): q = p.queue_helper if info.op_code == OpCodes.PING: q.add_log_cmd("Sending PUS TC [17,1]") - q.add_pus_tc(pack_service_17_ping_command()) + q.add_pus_tc(create_service_17_ping_command()) if info.op_code == OpCodes.TRIGGER_EVENT: q.add_log_cmd("Sending PUS TC Event Trigger [17, 128]") q.add_pus_tc(PusTelecommand(service=PusService.S17_TEST, subservice=128)) diff --git a/setup.cfg b/setup.cfg index 0be92c7..d351f9c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,7 +28,7 @@ classifiers = [options] install_requires = # tmtccmd @ git+https://github.com/robamu-org/tmtccmd@v4.0.0a1 - tmtccmd @ git+https://github.com/robamu-org/tmtccmd@667913bd7dd#egg=tmtccmd + tmtccmd @ git+https://github.com/robamu-org/tmtccmd@fa3c006d3ed#egg=tmtccmd packages = find: python_requires = >=3.10 include_package_data = True