update pcdu reply handling

This commit is contained in:
Robin Müller 2022-08-25 18:13:37 +02:00
parent df5d68315b
commit d61af604fe
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 8 additions and 6 deletions

View File

@ -43,7 +43,7 @@ def handle_action_reply(
PDU_2_HANDLER_ID, PDU_2_HANDLER_ID,
P60_DOCK_HANDLER, 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: else:
pw.dlog(f"No dedicated action reply handler found for reply from {object_id}") 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=',')}") pw.dlog(f"Raw Data: {tm_packet.custom_data.hex(sep=',')}")

View File

@ -19,6 +19,7 @@ from tmtccmd.tc.pus_3_fsfw_hk import (
generate_one_diag_command, generate_one_diag_command,
generate_one_hk_command, generate_one_hk_command,
) )
from tmtccmd.util import ObjectIdU32, ObjectIdBase
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
@ -447,26 +448,27 @@ def generic_off_cmd(
def handle_get_param_data_reply( 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: if action_id == GomspaceDeviceActionIds.PARAM_GET:
pw.dlog(f"Parameter Get Request received for object {obj_id}")
header_list = [ header_list = [
"Gomspace action ID", "Gomspace Request Code",
"Table ID", "Table ID",
"Memory Address", "Memory Address",
"Payload length", "Payload length",
"Payload", "Payload",
] ]
fmt_str = "!BBHH" 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] fmt_str, custom_data[:6]
) )
content_list = [ content_list = [
action, hex(gs_request_code),
table_id, table_id,
hex(address), hex(address),
payload_length, payload_length,
"0x" + custom_data[6:].hex(), f"0x[{custom_data[6:].hex(sep=',')}]"
] ]
pw.dlog(f"{header_list}") pw.dlog(f"{header_list}")
pw.dlog(f"{content_list}") pw.dlog(f"{content_list}")