Update PLOC SUPV TMTC handling #107

Merged
muellerr merged 24 commits from mueller/update-ploc-supv-cmds into main 2022-08-24 16:44:58 +02:00
Showing only changes of commit 7885b29d22 - Show all commits

View File

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