From ef0adef04aebf8aa0d673e14403b484bd1200d9c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 12 May 2023 15:51:17 +0200 Subject: [PATCH] start adding action reply handler for MPSoC --- eive_tmtc/pus_tm/action_reply_handler.py | 2 ++ eive_tmtc/tmtc/payload/ploc_mpsoc.py | 21 +++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/eive_tmtc/pus_tm/action_reply_handler.py b/eive_tmtc/pus_tm/action_reply_handler.py index bc556d4..7d23419 100644 --- a/eive_tmtc/pus_tm/action_reply_handler.py +++ b/eive_tmtc/pus_tm/action_reply_handler.py @@ -42,6 +42,8 @@ def handle_action_reply( return handle_core_ctrl_action_replies(action_id, printer, custom_data) elif object_id.as_bytes == STAR_TRACKER_ID: return handle_startracker_replies(action_id, printer, custom_data) + elif object_id.as_bytes == PLOC_MPSOC_ID: + return handle_mpsoc_data_reply(action_id, printer, custom_data) elif object_id.as_bytes in [ ACU_HANDLER_ID, PDU_1_HANDLER_ID, diff --git a/eive_tmtc/tmtc/payload/ploc_mpsoc.py b/eive_tmtc/tmtc/payload/ploc_mpsoc.py index deeb41d..8533075 100644 --- a/eive_tmtc/tmtc/payload/ploc_mpsoc.py +++ b/eive_tmtc/tmtc/payload/ploc_mpsoc.py @@ -233,14 +233,16 @@ def pack_ploc_mpsoc_commands(p: ServiceProviderParams): data = object_id.as_bytes + struct.pack("!I", ActionId.TC_DOWNLINK_PWR_OFF) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data)) if op_code == OpCode.FLASH_GET_DIR_CONTENT: - q.add_log_cmd(f"{prefix}: {OpCode.FLASH_GET_DIR_CONTENT}") - dir_name = input("Please specify MPSoC directory name to get information for") + q.add_log_cmd(f"{prefix}: {Info.FLASH_GET_DIR_CONTENT}") + dir_name = input("Please specify MPSoC directory name to get information for: ") dir_name = bytearray(dir_name.encode("utf-8")) dir_name.append(0) - return create_action_cmd( - object_id=object_id.as_bytes, - action_id=ActionId.TC_FLASH_DIR_GET_CONTENT, - user_data=dir_name, + q.add_pus_tc( + create_action_cmd( + object_id=object_id.as_bytes, + action_id=ActionId.TC_FLASH_DIR_GET_CONTENT, + user_data=dir_name, + ) ) if op_code == OpCode.REPLAY_WRITE_SEQ: q.add_log_cmd(f"{prefix}: {Info.REPLAY_WRITE_SEQ}") @@ -612,3 +614,10 @@ def handle_ploc_mpsoc_hk_data(printer: FsfwTmTcPrinter, hk_data: bytes, set_id: else: _LOGGER.warning(f"Unknown set ID {set_id} for MPSoC HK") pass + + +def handle_mpsoc_data_reply( + action_id: int, printer: FsfwTmTcPrinter, custom_data: bytes +): + print(f"Received MPSoC data reply with action ID {action_id}") + pass