diff --git a/tc/obsw_tc_service23_sdcard.py b/tc/obsw_tc_service23_sdcard.py index 4d0bfa24a4b1cfdcdb95e798d6f07a3a4472978a..bcc70f174313bf47f68eef5739b2f6227a7015e3 100644 --- a/tc/obsw_tc_service23_sdcard.py +++ b/tc/obsw_tc_service23_sdcard.py @@ -435,7 +435,7 @@ def generate_read_file_srv23_140_packet( return PusTelecommand(service=23, subservice=140, ssc=ssc, app_data=data_to_pack) -def generate_lock_file_packet(ssc: int, repository_path: str, filename: str, +def generate_lock_file_packet(ssc: int, lock: bool, repository_path: str, filename: str, object_id: bytearray = g.SD_CARD_HANDLER_ID): data_to_pack = bytearray(object_id) data_to_pack += repository_path.encode('utf-8') @@ -444,7 +444,10 @@ def generate_lock_file_packet(ssc: int, repository_path: str, filename: str, data_to_pack += filename.encode('utf-8') # Add string terminator of filename data_to_pack.append(0) - return PusTelecommand(service=23, subservice=5, ssc=ssc, app_data=data_to_pack) + if lock: + return PusTelecommand(service=23, subservice=5, ssc=ssc, app_data=data_to_pack) + else: + return PusTelecommand(service=23, subservice=6, ssc=ssc, app_data=data_to_pack) def pack_service23_commands_into(tc_queue: Deque, op_code: int) -> Deque: @@ -514,8 +517,8 @@ def pack_service23_commands_into(tc_queue: Deque, op_code: int) -> Deque: generate_generic_folder_structure(tc_queue, init_ssc=0, iobc=True) elif op_code == "5" or op_code == 5: - LOGGER.info("Press h in the following input requests to send a command to display the" - "folder sturcture instead") + LOGGER.info("Press h in the following input requests") + LOGGER.info("to send a command to display the folder sturcture instead") (repo_path, filename) = prompt_for_repo_filename() if repo_path == "" and filename == "h": tc_queue.append(("print", "Printing active file system")) @@ -524,7 +527,8 @@ def pack_service23_commands_into(tc_queue: Deque, op_code: int) -> Deque: return tc_queue else: tc_queue.append(("print", "Locking file")) - command = generate_lock_file_packet(0, repository_path=repo_path, filename=filename) + command = generate_lock_file_packet(0, repository_path=repo_path, filename=filename, + lock=True) tc_queue.appendleft(command.pack_command_tuple()) elif op_code == "6" or op_code == 6: @@ -538,7 +542,8 @@ def pack_service23_commands_into(tc_queue: Deque, op_code: int) -> Deque: return tc_queue else: tc_queue.append(("print", "Unlocking file")) - command = generate_lock_file_packet(0, repository_path=repo_path, filename=filename) + command = generate_lock_file_packet(0, repository_path=repo_path, filename=filename, + lock=False) tc_queue.appendleft(command.pack_command_tuple()) return tc_queue diff --git a/tm/obsw_tm_service_23.py b/tm/obsw_tm_service_23.py index 8d162aa5494a6ce09190cf3b60595ba8687feced..65cf912b3d08cac2b9c685aaf971400248631ae8 100644 --- a/tm/obsw_tm_service_23.py +++ b/tm/obsw_tm_service_23.py @@ -11,7 +11,8 @@ class Service23TM(PusTelemetry): self.filename = "" self.data_start_idx = 0 if self.get_subservice() == 132: - self.unpack_repo_and_filename() + # self.unpack_repo_and_filename() + pass def unpack_repo_and_filename(self): repo_path_found = False diff --git a/utility/obsw_binary_uploader.py b/utility/obsw_binary_uploader.py index 55ea1efc0e613861603f383ee9ed79a5bd322299..412bcdcd36538fecfcb966d26431aadaa5f616be 100644 --- a/utility/obsw_binary_uploader.py +++ b/utility/obsw_binary_uploader.py @@ -64,7 +64,7 @@ def perform_file_upload(com_if: CommunicationInterface, tmtc_printer: TmTcPrinte else: selection = input("Invalid input, try again [c to cancel]: ") - print_string = file_path.rsplit('/', 1)[-1] + " was selected." + print_string = file_path.rsplit(os.path.sep, 1)[-1] + " was selected." LOGGER.info(print_string) calc_hamming_code = input("Calculate and send hamming code? [y/n]: ") if calc_hamming_code in ['y', 'yes', 1]: @@ -175,7 +175,8 @@ def perform_file_upload(com_if: CommunicationInterface, tmtc_printer: TmTcPrinte for tm_list in reception_deque: for tm_packet in tm_list: if tm_packet.get_service() == 23 and tm_packet.get_subservice() == 132: - tmtc_printer.print_telemetry(tm_packet) + # tmtc_printer.print_telemetry(tm_packet) + pass tm_listener.clear_tm_packet_queue() LOGGER.info("Transitioning back to listener mode..")