start adding action reply handler for MPSoC

This commit is contained in:
Robin Müller 2023-05-12 15:51:17 +02:00
parent 377e98b5c2
commit ef0adef04a
Signed by: muellerr
GPG Key ID: A649FB78196E3849
2 changed files with 17 additions and 6 deletions

View File

@ -42,6 +42,8 @@ def handle_action_reply(
return handle_core_ctrl_action_replies(action_id, printer, custom_data) return handle_core_ctrl_action_replies(action_id, printer, custom_data)
elif object_id.as_bytes == STAR_TRACKER_ID: elif object_id.as_bytes == STAR_TRACKER_ID:
return handle_startracker_replies(action_id, printer, custom_data) 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 [ elif object_id.as_bytes in [
ACU_HANDLER_ID, ACU_HANDLER_ID,
PDU_1_HANDLER_ID, PDU_1_HANDLER_ID,

View File

@ -233,14 +233,16 @@ def pack_ploc_mpsoc_commands(p: ServiceProviderParams):
data = object_id.as_bytes + struct.pack("!I", ActionId.TC_DOWNLINK_PWR_OFF) 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)) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == OpCode.FLASH_GET_DIR_CONTENT: if op_code == OpCode.FLASH_GET_DIR_CONTENT:
q.add_log_cmd(f"{prefix}: {OpCode.FLASH_GET_DIR_CONTENT}") 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 = input("Please specify MPSoC directory name to get information for: ")
dir_name = bytearray(dir_name.encode("utf-8")) dir_name = bytearray(dir_name.encode("utf-8"))
dir_name.append(0) dir_name.append(0)
return create_action_cmd( q.add_pus_tc(
object_id=object_id.as_bytes, create_action_cmd(
action_id=ActionId.TC_FLASH_DIR_GET_CONTENT, object_id=object_id.as_bytes,
user_data=dir_name, action_id=ActionId.TC_FLASH_DIR_GET_CONTENT,
user_data=dir_name,
)
) )
if op_code == OpCode.REPLAY_WRITE_SEQ: if op_code == OpCode.REPLAY_WRITE_SEQ:
q.add_log_cmd(f"{prefix}: {Info.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: else:
_LOGGER.warning(f"Unknown set ID {set_id} for MPSoC HK") _LOGGER.warning(f"Unknown set ID {set_id} for MPSoC HK")
pass 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