From 7885b29d22f23f0e4432126dd6c1d22b592428cc Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 24 Aug 2022 12:06:49 +0200 Subject: [PATCH] update update command --- tmtc/ploc_supervisor.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tmtc/ploc_supervisor.py b/tmtc/ploc_supervisor.py index c0b8e50..ab03376 100644 --- a/tmtc/ploc_supervisor.py +++ b/tmtc/ploc_supervisor.py @@ -227,7 +227,7 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): q.add_log_cmd("PLOC Supervisor: Start MPSoC") command = obyt + struct.pack("!I", SupvActionIds.START_MPSOC) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command)) - if op_code == "6": + if op_code in OpCodes.STOP_MPSOC: q.add_log_cmd("PLOC Supervisor: Shutdown MPSoC") command = object_id.as_bytes + struct.pack("!I", SupvActionIds.SHUTWOWN_MPSOC) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command)) @@ -641,6 +641,13 @@ def pack_update_command(object_id: bytes) -> bytearray: init_seq_count = input("Specify initial sequence count [1 default]: ") if init_seq_count == "": init_seq_count = 0 + del_mem = input("Delete memory? [y/n, y default]: ") + if del_mem.lower() in ["y", "1"]: + del_mem = 1 + elif del_mem.lower() in ["n", "0"]: + del_mem = 0 + else: + raise ValueError("Invalid input, use y or n") init_seq_count = int(init_seq_count) command += object_id command += struct.pack("!I", SupvActionIds.PERFORM_UPDATE) @@ -651,6 +658,7 @@ def pack_update_command(object_id: bytes) -> bytearray: command += struct.pack("!I", start_address) command.extend(struct.pack("!I", init_bytes_written)) command.extend(struct.pack("!H", init_seq_count)) + command.append(del_mem) return bytearray(command)