From c4bd355146a2f5894a93a30f0c7f61aeef43e764 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Nov 2023 18:18:40 +0100 Subject: [PATCH] PLOC SUPV extensions --- eive_tmtc/config/object_ids.py | 3 +++ eive_tmtc/tmtc/payload/ploc_supervisor.py | 8 ++++---- eive_tmtc/tmtc/power/p60dock.py | 10 ++++++---- tmtcc.py | 3 ++- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/eive_tmtc/config/object_ids.py b/eive_tmtc/config/object_ids.py index af77351..cb81d07 100644 --- a/eive_tmtc/config/object_ids.py +++ b/eive_tmtc/config/object_ids.py @@ -167,6 +167,9 @@ NOT_OK_TM_STORE = bytes([0x73, 0x02, 0x00, 0x03]) HK_TM_STORE = bytes([0x73, 0x02, 0x00, 0x04]) CFDP_TM_STORE = bytes([0x73, 0x03, 0x00, 0x00]) + +SUPV_FILTER_SET = [PLOC_SUPV_ID, PDU_2_HANDLER_ID, PDU_1_HANDLER_ID] + ObjectIdDict = Dict[bytes, ObjectIdU32] diff --git a/eive_tmtc/tmtc/payload/ploc_supervisor.py b/eive_tmtc/tmtc/payload/ploc_supervisor.py index 31e8071..9700ce7 100644 --- a/eive_tmtc/tmtc/payload/ploc_supervisor.py +++ b/eive_tmtc/tmtc/payload/ploc_supervisor.py @@ -676,10 +676,10 @@ def pack_set_gpio_cmd(object_id: bytes) -> bytearray: port = int(input("Specify port: 0x"), 16) pin = int(input("Specify pin: 0x"), 16) val = int(input("Specify val: 0x"), 16) - command = object_id + struct.pack("!I", SupvActionId.SET_GPIO) - command = command + struct.pack("!B", port) - command = command + struct.pack("!B", pin) - command = command + struct.pack("!B", val) + command = bytearray(object_id + struct.pack("!I", SupvActionId.SET_GPIO)) + command.append(port) + command.append(pin) + command.append(val) return bytearray(command) diff --git a/eive_tmtc/tmtc/power/p60dock.py b/eive_tmtc/tmtc/power/p60dock.py index b8908a6..eeb8e2b 100644 --- a/eive_tmtc/tmtc/power/p60dock.py +++ b/eive_tmtc/tmtc/power/p60dock.py @@ -28,10 +28,12 @@ from tmtccmd.util import ObjectIdU32 class P60OpCode: - STACK_3V3_ON = ["stack_3v3_on", "1"] - STACK_3V3_OFF = ["stack_3v3_off", "2"] - STACK_5V_ON = ["stack_5v_on", "3"] - STACK_5V_OFF = ["stack_5v_off", "4"] + STACK_3V3_ON = "stack_3v3_on" + STACK_3V3_OFF = "stack_3v3_off" + STACK_5V_ON = "stack_5v_on" + STACK_5V_OFF = "stack_5v_off" + ACU_OFF = "acu_off" + ACU_ON = "acu_on" TEST = ["test", "0"] diff --git a/tmtcc.py b/tmtcc.py index a4721d7..6952ac8 100755 --- a/tmtcc.py +++ b/tmtcc.py @@ -55,6 +55,7 @@ from eive_tmtc.config.definitions import ( CFDP_REMOTE_ENTITY_ID, ) from eive_tmtc.config.hook import EiveHookObject +from eive_tmtc.config.object_ids import SUPV_FILTER_SET from eive_tmtc.pus_tm.pus_demux import pus_factory_hook _LOGGER = APP_LOGGER @@ -78,7 +79,7 @@ class PusHandler(SpecificApidHandlerBase): self.verif_wrapper = wrapper self.raw_logger = raw_logger self.hk_level = hk_level - self.these_objs_hk_only = [] + self.these_objs_hk_only = SUPV_FILTER_SET self.hk_filter = HkFilter(object_ids=self.these_objs_hk_only, set_ids=[]) def handle_tm(self, packet: bytes, _user_args: any):