From 268c9e3f0bad021b925da5cf10a2116de3083a60 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 8 Apr 2023 11:39:41 +0200 Subject: [PATCH] add prompts for custom file name --- eive_tmtc/tmtc/core.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eive_tmtc/tmtc/core.py b/eive_tmtc/tmtc/core.py index bd5d060..4ea1d46 100644 --- a/eive_tmtc/tmtc/core.py +++ b/eive_tmtc/tmtc/core.py @@ -343,7 +343,11 @@ def determine_chip_and_copy() -> (int, int): def pack_obsw_update_cmd(action_id: int) -> PusTelecommand: chip, copy = determine_chip_and_copy() - user_data = bytes([chip, copy]) + user_data = bytearray([chip, copy]) + custom_file_name = input("Use custom filename [y/n] ?: ") + if custom_file_name.lower() in ["y", "yes", "1"]: + custom_file_name = input("Specify custom filename: ") + user_data.extend(custom_file_name.encode()) return create_action_cmd( object_id=CORE_CONTROLLER_ID, action_id=action_id, user_data=user_data )