From 7a222e4e15887554e5414350a4cea360229994b2 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" <robin.mueller.m@gmail.com> Date: Mon, 5 Oct 2020 22:47:03 +0200 Subject: [PATCH] srv23 continued --- tc/obsw_tc_service23.py | 5 +---- utility/obsw_binary_uploader.py | 11 ++++++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tc/obsw_tc_service23.py b/tc/obsw_tc_service23.py index 5366c5b..b4cd850 100644 --- a/tc/obsw_tc_service23.py +++ b/tc/obsw_tc_service23.py @@ -201,6 +201,7 @@ def generate_format_sd_card_packet( app_data = bytearray(object_id) return PusTelecommand(service=23, subservice=182, ssc=ssc, app_data=app_data) + def generate_generic_folder_structure( tc_queue: Deque, init_ssc: int, object_id: bytearray = g.SD_CARD_HANDLER_ID, iobc: bool = False): @@ -241,10 +242,6 @@ def generate_generic_folder_structure( command = generate_mkdir_srv23_9_packet("BIN", ssc=init_ssc) tc_queue.appendleft(command.pack_command_tuple()) init_ssc += 1 - command = generate_mkdir_srv23_9_packet( - repository_path="BIN", directory_name="AT91", ssc=init_ssc) - tc_queue.appendleft(command.pack_command_tuple()) - init_ssc += 1 if iobc: command = generate_mkdir_srv23_9_packet( repository_path="BIN", directory_name="IOBC", ssc=init_ssc) diff --git a/utility/obsw_binary_uploader.py b/utility/obsw_binary_uploader.py index aeae705..2af1725 100644 --- a/utility/obsw_binary_uploader.py +++ b/utility/obsw_binary_uploader.py @@ -46,8 +46,11 @@ def perform_binary_upload(com_if: CommunicationInterface): pass # Read file as binary file - with open(file_path, 'rb') as file: - data_to_read = bytearray(file.read()) + if file_path != (): + with open(file_path, 'rb') as file: + data_to_read = bytearray(file.read()) + else: + LOGGER.info("Specified path invalid..") print("Generating folder structure..") tc_queue = deque() @@ -59,7 +62,9 @@ def perform_binary_upload(com_if: CommunicationInterface): elif tc_packet == "print": LOGGER.info(tc_info) - time.sleep(0.5) + time.sleep(0.2) + tm_list = com_if.receive_telemetry() + LOGGER.info(str(len(tm_list)) + " TM packets received..") # Delete existing binary file first, otherwise data might be appended to otherwise # valid file which already exists. -- GitLab