mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
2nd test run with saving data from tnc
This commit is contained in:
parent
76f24f2b31
commit
e2d4b58e30
1 changed files with 13 additions and 7 deletions
|
@ -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,10 +3107,13 @@ class DATA:
|
||||||
os.makedirs(f"{folder_path}/{callsign_path}")
|
os.makedirs(f"{folder_path}/{callsign_path}")
|
||||||
|
|
||||||
# save file to folder
|
# save file to folder
|
||||||
|
if filename not in [b'', b'undefined']:
|
||||||
|
filename = str(filename, "UTF-8")
|
||||||
filename_complex = f"{timestamp}_{transmission_uuid}_{filename}"
|
filename_complex = f"{timestamp}_{transmission_uuid}_{filename}"
|
||||||
with open(f"{folder_path}/{callsign_path}/{filename_complex}", "wb") as file:
|
with open(f"{folder_path}/{callsign_path}/{filename_complex}", "wb") as file:
|
||||||
file.write(data)
|
file.write(data)
|
||||||
|
|
||||||
|
if message not in [b'', b'undefined']:
|
||||||
# save message to folder
|
# save message to folder
|
||||||
message_name = f"{timestamp}_{transmission_uuid}_msg.txt"
|
message_name = f"{timestamp}_{transmission_uuid}_msg.txt"
|
||||||
with open(f"{folder_path}/{callsign_path}/{message_name}", "wb") as file:
|
with open(f"{folder_path}/{callsign_path}/{message_name}", "wb") as file:
|
||||||
|
|
Loading…
Reference in a new issue