implement PLOC SUPV fac reset cmd

This commit is contained in:
Robin Müller 2022-12-23 10:17:44 +01:00
parent 20c2f61555
commit 825a1972c4
1 changed files with 13 additions and 1 deletions

View File

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