From ef23aced2bc23e5bb34e92a7aaa5c272f83bcaa4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 17 Nov 2022 16:51:12 +0100 Subject: [PATCH] factory flash op code --- tmtc/payload/ploc_supervisor.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tmtc/payload/ploc_supervisor.py b/tmtc/payload/ploc_supervisor.py index 808cbc1..f5d8c3a 100644 --- a/tmtc/payload/ploc_supervisor.py +++ b/tmtc/payload/ploc_supervisor.py @@ -126,6 +126,7 @@ class OpCodes: SHUTDOWN_MPSOC = ["6", "stop_mpsoc"] SEL_NVM = ["7", "sel_nvm"] SET_TIME_REF = ["set_time_ref"] + FACTORY_FLASH = ["factory_flash"] REQ_BOOT_STATUS_REPORT = ["13", "boot_report"] START_UPDATE = ["42", "start_update"] PERFORM_UPDATE = ["update"] @@ -140,6 +141,7 @@ class Info(str, enum.Enum): HK_TO_OBC = "Request HK from PLOC SUPV" REQUEST_HK = "Request HK set from PLOC Handler" SET_TIME_REF = "Set time reference" + FACTORY_FLASH = "Factory Flash Mode" PERFORM_UPDATE = "Start or continue MPSoC SW update at starting bytes" START_UPDATE = "Start new MPSoC SW update" REQ_BOOT_STATUS_REPORT = "Request boot status report and HK" @@ -186,7 +188,7 @@ def add_ploc_supv_cmds(defs: TmtcDefinitionWrapper): oce.add("43", "PLOC Supervisor: Terminate supervisor process") oce.add("44", "PLOC Supervisor: Start MPSoC quiet") oce.add("45", "PLOC Supervisor: Set shutdown timeout") - oce.add("46", "PLOC Supervisor: Factory flash") + oce.add(OpCodes.FACTORY_FLASH, Info.FACTORY_FLASH) oce.add("47", "PLOC Supervisor: Enable auto TM") oce.add("48", "PLOC Supervisor: Disable auto TM") oce.add("51", "PLOC Supervisor: Logging request event buffers") @@ -386,8 +388,8 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): q.add_log_cmd("PLOC Supervisor: Set shutdown timeout") command = pack_set_shutdown_timeout_command(object_id.as_bytes) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command)) - if op_code == "46": - q.add_log_cmd("PLOC Supervisor: Factory flash") + if op_code in OpCodes.FACTORY_FLASH: + q.add_log_cmd(Info.FACTORY_FLASH) command = object_id.as_bytes + struct.pack("!I", SupvActionIds.FACTORY_FLASH) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command)) if op_code == "47":