# If SSID was not pressent (and we added the default -0 to it), the has_been_repeated flag could be at the end of the call, so check that as well
# Also, there is a lot of bad software around (including this code) and ignorance of the specifications (are there any specs for LoRa APRS?), so always check for the has_been_repeated flag
ifcall[-1]==42:
call=call[:-1]
encoded_ssid|=0b10000000
# SSID should now be one or two postions long and contain a number (idealy between 0 and 15).
# First check: do we have a semi column (seperator path field and data field)
# Note that we could still be wrong: for example when the field seperator is corrupted and we now find a semi column from, lets say, an internet address in the data field...
ifnotb":"inframe:
returnNone
# Split the frame in a path field and a data field
path=frame.split(b":")[0]
data_field=frame[frame.find(b":")+1:]
# The source address is always followed by a greather than sign, so lets see if its there.
# There is always a change that there is another greather than sign because the frame could be corrupted...
ifnotb">"inpath:
returnNone
# Split the path into a source address and a digi-path array (because digis should be seperated by commas, but again, corruption....)