add prompts for custom file name

This commit is contained in:
Robin Müller 2023-04-08 11:39:41 +02:00
parent 9edbdf1a8d
commit 268c9e3f0b
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -343,7 +343,11 @@ def determine_chip_and_copy() -> (int, int):
def pack_obsw_update_cmd(action_id: int) -> PusTelecommand: def pack_obsw_update_cmd(action_id: int) -> PusTelecommand:
chip, copy = determine_chip_and_copy() 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( return create_action_cmd(
object_id=CORE_CONTROLLER_ID, action_id=action_id, user_data=user_data object_id=CORE_CONTROLLER_ID, action_id=action_id, user_data=user_data
) )