Power Command Updates #110

Merged
meierj merged 10 commits from mueller/power-cmds-update into main 2022-08-28 10:25:53 +02:00
2 changed files with 8 additions and 6 deletions
Showing only changes of commit d61af604fe - Show all commits

View File

@ -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=',')}")

View File

@ -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}")