From 0773ee372aa0209c4df88dc5d32758fccdbb84a8 Mon Sep 17 00:00:00 2001 From: Rossen Georgiev Date: Tue, 30 Dec 2014 17:41:14 +0000 Subject: [PATCH] only check for beacon type, when all else fails related to #3 --- aprslib/parse.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aprslib/parse.py b/aprslib/parse.py index af76e96..a74fa3e 100644 --- a/aprslib/parse.py +++ b/aprslib/parse.py @@ -620,7 +620,9 @@ def parse(raw_sentence): # [ - maidenhead locator beacon elif packet_type in '%,{?T*_#$);[<': raise UnknownFormat("format is not supported", raw_sentence) - else: + + # if we fail all attempts to parse, try beacon packet + if 'format' not in parsed: if not re.match(r"^(AIR.*|ALL.*|AP.*|BEACON|CQ.*|GPS.*|DF.*|DGPS.*|" "DRILL.*|DX.*|ID.*|JAVA.*|MAIL.*|MICE.*|QST.*|QTH.*|" "RTCM.*|SKY.*|SPACE.*|SPC.*|SYM.*|TEL.*|TEST.*|TLM.*|"