mem check now always based on file

This commit is contained in:
Robin Müller 2022-08-22 13:41:07 +02:00
parent 425870d161
commit 5651475955
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC

View File

@ -431,15 +431,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.MEM_CHECK:
custom_data = bytearray()
update_file = get_update_file()
memory_id = int(input("Specify memory ID: "))
start_address = int(input("Specify start address: 0x"), 16)
check_size = int(input("Specify check size: "))
custom_data.extend(update_file.encode("utf-8"))
custom_data.append(0)
custom_data.extend(struct.pack("!B", memory_id))
custom_data.extend(struct.pack("!I", start_address))
custom_data.extend(struct.pack("!I", check_size))
q.add_log_cmd(
f"{prefix}: {Info.MEM_CHECK} for memory ID {memory_id} at start "
f"address {start_address} with check size {check_size}"
f"{prefix}: {Info.MEM_CHECK} for file {update_file} at memory ID {memory_id} at start "
f"address {start_address}"
)
command = make_fsfw_action_cmd(
object_id.as_bytes, SupvActionIds.MEM_CHECK, custom_data