handle split char false positive

This commit is contained in:
DJ2LS 2022-12-28 17:37:50 +01:00
parent 17977b5281
commit 2392ff3b53

View file

@ -3104,7 +3104,13 @@ class DATA:
os.makedirs(f"{folder_path}/{callsign_path}")
split_char = b"\0;\1;"
n_objects = 8
decoded_data = data_frame.split(split_char)
# if we have a false positive in case our split_char is available in data
# lets stick the data together, so we are not loosing it
if len(decoded_data) > n_objects:
file_data = b''.join(list[n_objects:])
decoded_data = [*decoded_data[:n_objects], file_data]
if decoded_data[0] in [b'm']:
checksum_delivered = str(decoded_data[2], "utf-8").lower()