diff --git a/utility/tmtcc_binary_uploader.py b/utility/tmtcc_binary_uploader.py index eb132bea2e2c932200e6d782374d653deb8a5eeb..d3a054ccf993062f057900079f72ee8940c13f90 100644 --- a/utility/tmtcc_binary_uploader.py +++ b/utility/tmtcc_binary_uploader.py @@ -226,7 +226,9 @@ class BinaryFileUploader: time.sleep(time_to_sleep) # handle last telemetry packets coming in. - time_till_wake = time.time() + 5 + wait_time = 4 + LOGGER.info("Waiting " + str(wait_time) + " more seconds for TM packets..") + time_till_wake = time.time() + wait_time while time.time() < time_till_wake: new_packets_received += self.__handle_tm_queue(reception_dict) time.sleep(1) @@ -259,15 +261,17 @@ class BinaryFileUploader: reception_dict.update({tc_ssc: acceptance_list}) elif packet.get_service() == 5: # TODO: print event - print("Event received!") + LOGGER.info("Event received!") else: - print("Other TM packet with service ID" + str(packet.get_service()) + - " received!") + print_string = "Other TM packet with service ID " + str(packet.get_service()) + \ + " received!" + LOGGER.info(print_string) clear_list = [] for key, reception_list in reception_dict.items(): if reception_list[1] and reception_list[2] and reception_list[3]: # All replies received, we can delete the entry and confirm succesfull handling - print("All replies received for upload packet with SSC " + str(key) + ".") + print_string = "All replies received for upload packet with SSC " + str(key) + "." + LOGGER.info(print_string) clear_list.append(key) elif reception_list[0] > 5: # No replies for telecommand. diff --git a/utility/tmtcc_file_transfer_helper.py b/utility/tmtcc_file_transfer_helper.py index 69d9e82cc0d1aa459581cdba1e84db4165c7caa6..20ca7be2f7656533ebcfe4078305922b7c75242b 100644 --- a/utility/tmtcc_file_transfer_helper.py +++ b/utility/tmtcc_file_transfer_helper.py @@ -223,6 +223,7 @@ class FileTransferHelper: header += data[number_of_packets * size_of_data_blocks:len(data)] commands = PusTelecommand(service=23, subservice=130, ssc=init_ssc + packet_sequence_number, app_data=header) + self.__current_ssc = init_ssc + packet_sequence_number self.tc_queue.appendleft(commands.pack_command_tuple()) def __handle_finish_and_lock_packet_generation(self): @@ -230,11 +231,13 @@ class FileTransferHelper: last_command = generate_finish_append_to_file_srv23_131_packet( filename=self.target_filename, repository_path=self.target_repository, ssc=self.__current_ssc, lock_file=self.__lock_file) + self.__current_ssc += 1 else: if self.__lock_file: last_command = generate_lock_file_srv23_5_6_packet( filename=self.target_filename, repository_path=self.target_repository, object_id=self.object_id, lock=True, ssc=self.__current_ssc) + self.__current_ssc += 1 else: self.__number_of_finish_packets = 0 return