From 825a1972c4ca63f8044eff582a97b4221d513fec Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 23 Dec 2022 10:17:44 +0100 Subject: [PATCH] implement PLOC SUPV fac reset cmd --- eive_tmtc/tmtc/payload/ploc_supervisor.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/eive_tmtc/tmtc/payload/ploc_supervisor.py b/eive_tmtc/tmtc/payload/ploc_supervisor.py index cefad97..49dea9d 100644 --- a/eive_tmtc/tmtc/payload/ploc_supervisor.py +++ b/eive_tmtc/tmtc/payload/ploc_supervisor.py @@ -64,7 +64,7 @@ event_buffer_path_dict = { } -FactoryResetOp = { +FACTORY_RESET_OPS = { 0x00: "CLEAR_MRAM_EVENT_BUF", 0x01: "CLEAR_MRAM_ADC_BUF", 0x02: "FACTORY_DEFAULT_MRAM_SYS_CFG", @@ -81,6 +81,8 @@ FactoryResetOp = { 0x11: "REDWIRE_TASK_2", 0x12: "REDWIRE_TASK_3", } + + class SupvActionIds: HK_REPORT = 1 START_MPSOC = 3 @@ -267,6 +269,16 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command)) if op_code in OpCodes.FACTORY_RESET: q.add_log_cmd(f"{prefix}: {Info.FACTORY_RESET}") + key = -1 + while True: + print("Please select the key for a factory reset operation") + for key, val in FACTORY_RESET_OPS: + print(f"{key}: {val}") + key = int(input("Key Select: ")) + if key not in FACTORY_RESET_OPS: + print("Key invalid!") + break + q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=bytes([key]))) if op_code == "8": q.add_log_cmd("PLOC Supervisor: Set max restart tries") restart_tries = int(input("Specify maximum restart tries: "))