From d61af604fec53b6a0af8d54e7c01792fc9a68790 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 25 Aug 2022 18:13:37 +0200 Subject: [PATCH] update pcdu reply handling --- pus_tm/action_reply_handler.py | 2 +- tmtc/power/common_power.py | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pus_tm/action_reply_handler.py b/pus_tm/action_reply_handler.py index 5f52858..d9fc381 100644 --- a/pus_tm/action_reply_handler.py +++ b/pus_tm/action_reply_handler.py @@ -43,7 +43,7 @@ def handle_action_reply( PDU_2_HANDLER_ID, P60_DOCK_HANDLER, ]: - return handle_get_param_data_reply(action_id, pw, custom_data) + return handle_get_param_data_reply(object_id, action_id, pw, custom_data) else: pw.dlog(f"No dedicated action reply handler found for reply from {object_id}") pw.dlog(f"Raw Data: {tm_packet.custom_data.hex(sep=',')}") diff --git a/tmtc/power/common_power.py b/tmtc/power/common_power.py index cf49e81..9987543 100644 --- a/tmtc/power/common_power.py +++ b/tmtc/power/common_power.py @@ -19,6 +19,7 @@ from tmtccmd.tc.pus_3_fsfw_hk import ( generate_one_diag_command, generate_one_hk_command, ) +from tmtccmd.util import ObjectIdU32, ObjectIdBase from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter @@ -447,26 +448,27 @@ def generic_off_cmd( def handle_get_param_data_reply( - action_id: int, pw: PrintWrapper, custom_data: bytearray + obj_id: ObjectIdBase, action_id: int, pw: PrintWrapper, custom_data: bytearray ): if action_id == GomspaceDeviceActionIds.PARAM_GET: + pw.dlog(f"Parameter Get Request received for object {obj_id}") header_list = [ - "Gomspace action ID", + "Gomspace Request Code", "Table ID", "Memory Address", "Payload length", "Payload", ] fmt_str = "!BBHH" - (action, table_id, address, payload_length) = struct.unpack( + (gs_request_code, table_id, address, payload_length) = struct.unpack( fmt_str, custom_data[:6] ) content_list = [ - action, + hex(gs_request_code), table_id, hex(address), payload_length, - "0x" + custom_data[6:].hex(), + f"0x[{custom_data[6:].hex(sep=',')}]" ] pw.dlog(f"{header_list}") pw.dlog(f"{content_list}")