optimize
This commit is contained in:
parent
bdbe45e322
commit
1eb28d6aee
11
owrx/aprs.py
11
owrx/aprs.py
@ -134,17 +134,20 @@ class AprsParser(object):
|
|||||||
|
|
||||||
information = information.decode(encoding, "replace")
|
information = information.decode(encoding, "replace")
|
||||||
|
|
||||||
if information[0] == "!" or information[0] == "=":
|
# APRS data type identifier
|
||||||
|
dti = information[0]
|
||||||
|
|
||||||
|
if dti == "!" or dti == "=":
|
||||||
# position without timestamp
|
# position without timestamp
|
||||||
aprsData.update(self.parseRegularAprsData(information[1:]))
|
aprsData.update(self.parseRegularAprsData(information[1:]))
|
||||||
elif information[0] == "/" or information[0] == "@":
|
elif dti == "/" or dti == "@":
|
||||||
# position with timestamp
|
# position with timestamp
|
||||||
aprsData["timestamp"] = self.parseTimestamp(information[1:8])
|
aprsData["timestamp"] = self.parseTimestamp(information[1:8])
|
||||||
aprsData.update(self.parseRegularAprsData(information[8:]))
|
aprsData.update(self.parseRegularAprsData(information[8:]))
|
||||||
elif information[0] == ">":
|
elif dti == ">":
|
||||||
# status update
|
# status update
|
||||||
aprsData.update(self.parseStatusUpate(information[1:]))
|
aprsData.update(self.parseStatusUpate(information[1:]))
|
||||||
elif information[0] == "}":
|
elif dti == "}":
|
||||||
# third party
|
# third party
|
||||||
aprsData["type"] = "thirdparty"
|
aprsData["type"] = "thirdparty"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user