Merge pull request #10 from kerel-fs/fix/relaxed-aprs-dstcall

Fix/relaxed aprs dstcall
pull/8/merge
Fabian P. Schmidt 2016-09-01 11:45:10 +02:00 zatwierdzone przez GitHub
commit 9adbe68082
4 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -1,6 +1,8 @@
# CHANGELOG
## Unreleased
- Added aprs destination callsign as `dstcall` to aprs beacon keys
- Changed aprs parser to allow other destination calls than `APRS`
## 0.4.0 - 2016-03-29
- aprs client: Added the possibility of a timed callback

Wyświetl plik

@ -36,11 +36,9 @@ def process_beacon(raw_message):
if raw_message[0] == '#':
print('Server Status: {}'.format(raw_message))
return
try:
beacon = parse_aprs(raw_message)
beacon.update(parse_ogn_beacon(beacon['comment']))
print('Received {beacon_type} from {name}'.format(**beacon))
except ParseError as e:
print('Error, {}'.format(e.message))

Wyświetl plik

@ -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) +

Wyświetl plik

@ -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