kopia lustrzana https://github.com/glidernet/python-ogn-client
Relax APRS packet parser pattern to allow other destination calls than APRS
APRS spec allows any callsign-like string, and it is widely used to signal which software or device generated the packet. For OGN use, I would recommend using OGN-specific destination callsigns, maybe software/tracker-specific OGN-prefixed calls. APRS tocall index is found here, AP-prefixed tocalls are used for APRS devices. https://github.com/hessu/aprs-deviceid/blob/master/tocalls.yaml Fixes #9.pull/10/head
rodzic
58cceb9aa2
commit
de99c3b052
|
@ -14,6 +14,7 @@ def parse_aprs(message, reference_date=None):
|
|||
if match:
|
||||
return {'name': match.group('callsign'),
|
||||
'receiver_name': match.group('receiver'),
|
||||
'dstcall': match.group('dstcall'),
|
||||
'timestamp': createTimestamp(match.group('time'), reference_date),
|
||||
'latitude': dmsToDeg(float(match.group('latitude')) / 100) *
|
||||
(-1 if match.group('latitude_sign') == 'S' else 1) +
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import re
|
||||
|
||||
|
||||
PATTERN_APRS = re.compile(r"^(?P<callsign>.+?)>APRS,.+,(?P<receiver>.+?):/(?P<time>\d{6})+h(?P<latitude>\d{4}\.\d{2})(?P<latitude_sign>N|S)(?P<symbol_table>.)(?P<longitude>\d{5}\.\d{2})(?P<longitude_sign>E|W)(?P<symbol>.)(?P<course_extension>(?P<course>\d{3})/(?P<ground_speed>\d{3}))?/A=(?P<altitude>\d{6})(?P<pos_extension>\s!W((?P<latitude_enhancement>\d)(?P<longitude_enhancement>\d))!)?\s(?P<comment>.*)$")
|
||||
PATTERN_APRS = re.compile(r"^(?P<callsign>.+?)>(?P<dstcall>[A-Z0-9]+),.+,(?P<receiver>.+?):/(?P<time>\d{6})+h(?P<latitude>\d{4}\.\d{2})(?P<latitude_sign>N|S)(?P<symbol_table>.)(?P<longitude>\d{5}\.\d{2})(?P<longitude_sign>E|W)(?P<symbol>.)(?P<course_extension>(?P<course>\d{3})/(?P<ground_speed>\d{3}))?/A=(?P<altitude>\d{6})(?P<pos_extension>\s!W((?P<latitude_enhancement>\d)(?P<longitude_enhancement>\d))!)?\s(?P<comment>.*)$")
|
||||
|
||||
# The following regexp patterns are part of the ruby ogn-client.
|
||||
# source: https://github.com/svoop/ogn_client-ruby
|
||||
|
|
Ładowanie…
Reference in New Issue