2nd test run with saving data from tnc

This commit is contained in:
DJ2LS 2022-12-26 10:35:58 +01:00
parent 76f24f2b31
commit e2d4b58e30

View file

@ -3086,6 +3086,9 @@ class DATA:
self.log.info("[TNC] ARQ | RX | saving data to folder") self.log.info("[TNC] ARQ | RX | saving data to folder")
mycallsign = str(mycallsign, "UTF-8")
dxcallsign = str(dxcallsign, "UTF-8")
decoded_data = data_frame.split(split_char) decoded_data = data_frame.split(split_char)
print(decoded_data) print(decoded_data)
#uuid=decoded_data[3] #uuid=decoded_data[3]
@ -3104,14 +3107,17 @@ class DATA:
os.makedirs(f"{folder_path}/{callsign_path}") os.makedirs(f"{folder_path}/{callsign_path}")
# save file to folder # save file to folder
filename_complex = f"{timestamp}_{transmission_uuid}_{filename}" if filename not in [b'', b'undefined']:
with open(f"{folder_path}/{callsign_path}/{filename_complex}", "wb") as file: filename = str(filename, "UTF-8")
file.write(data) filename_complex = f"{timestamp}_{transmission_uuid}_{filename}"
with open(f"{folder_path}/{callsign_path}/{filename_complex}", "wb") as file:
file.write(data)
# save message to folder if message not in [b'', b'undefined']:
message_name = f"{timestamp}_{transmission_uuid}_msg.txt" # save message to folder
with open(f"{folder_path}/{callsign_path}/{message_name}", "wb") as file: message_name = f"{timestamp}_{transmission_uuid}_msg.txt"
file.write(message) with open(f"{folder_path}/{callsign_path}/{message_name}", "wb") as file:
file.write(message)
except Exception as e: except Exception as e:
print(e) print(e)