Skip to content
Snippets Groups Projects
Commit e43a33ea authored by Robin Mueller's avatar Robin Mueller
Browse files

minor improvements and bugfixes

parent ae4024e2
Branches
No related tags found
No related merge requests found
......@@ -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.
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment