From 439da266a9136b44e029b90dfbf2b59f6268df3e Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Thu, 15 Aug 2019 15:53:55 +0200 Subject: [PATCH] prevent empty frames --- owrx/aprs.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/owrx/aprs.py b/owrx/aprs.py index e0ead98d..e4f67d30 100644 --- a/owrx/aprs.py +++ b/owrx/aprs.py @@ -155,18 +155,19 @@ class AprsParser(object): if information[0] == "!" or information[0] == "=": # position without timestamp - information = information[1:] + aprsData.update(self.parseRegularAprsData(information[1:])) elif information[0] == "/" or information[0] == "@": # position with timestamp # TODO parse timestamp - information = information[8:] - else: - return {} + aprsData.update(self.parseRegularAprsData(information[8:])) + return aprsData + + def parseRegularAprsData(self, information): if self.hasCompressedCoordinatesx(information): - aprsData.update(self.parseCompressedCoordinates(information[0:10])) + aprsData = self.parseCompressedCoordinates(information[0:10]) aprsData["comment"] = information[10:] else: - aprsData.update(self.parseUncompressedCoordinates(information[0:19])) + aprsData = self.parseUncompressedCoordinates(information[0:19]) aprsData["comment"] = information[19:] return aprsData