From e23b39e652a35e5124221b0f5643ef07eb7676b7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 16 May 2024 11:03:55 +0200 Subject: [PATCH] action reply update --- eive_tmtc/config/definitions.py | 1 + eive_tmtc/config/hook.py | 2 +- eive_tmtc/pus_tm/action_reply_handler.py | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/eive_tmtc/config/definitions.py b/eive_tmtc/config/definitions.py index e1ecece..8d32cbf 100644 --- a/eive_tmtc/config/definitions.py +++ b/eive_tmtc/config/definitions.py @@ -17,6 +17,7 @@ TM_DB_PATH = "tm.db" # TODO: The cleanest way would be to load those from the config file.. PRINT_RAW_HK_B64_STR = False +PRINT_RAW_ACTION_DATA_REPLY_B64_STR = True PRINT_RAW_EVENTS_B64_STR = False PUS_APID = 0x65 diff --git a/eive_tmtc/config/hook.py b/eive_tmtc/config/hook.py index 864b264..46617f4 100644 --- a/eive_tmtc/config/hook.py +++ b/eive_tmtc/config/hook.py @@ -52,7 +52,7 @@ from eive_tmtc.tmtc.wdt import create_wdt_node class EiveHookObject(HookBase): def __init__(self, json_cfg_path: str): - super().__init__(json_cfg_path=json_cfg_path) + super().__init__(json_cfg_path) def get_command_definitions(self) -> CmdTreeNode: root_node = CmdTreeNode.root_node() diff --git a/eive_tmtc/pus_tm/action_reply_handler.py b/eive_tmtc/pus_tm/action_reply_handler.py index 9ce56eb..14412e8 100644 --- a/eive_tmtc/pus_tm/action_reply_handler.py +++ b/eive_tmtc/pus_tm/action_reply_handler.py @@ -1,8 +1,10 @@ +import base64 import logging import struct from spacepackets.ecss import PusTm from tmtccmd.pus.s8_fsfw_action_defs import CustomSubservice +from eive_tmtc.config.definitions import PRINT_RAW_ACTION_DATA_REPLY_B64_STR from eive_tmtc.config.object_ids import ( ACU_HANDLER_ID, PDU_1_HANDLER_ID, @@ -51,6 +53,8 @@ def handle_action_service_tm( if object_id is None: object_id = ObjectIdU32(object_id_raw, "Unknown ID") if tm_packet.subservice == CustomSubservice.TM_DATA_REPLY: + if PRINT_RAW_ACTION_DATA_REPLY_B64_STR: + print(f"PUS TM Base64: {base64.b64encode(raw_tm)}") if object_id.as_bytes == IMTQ_HANDLER_ID: return handle_imtq_replies(action_id, pw, custom_data) elif object_id.as_bytes == PLOC_MPSOC_ID: