kopia lustrzana https://github.com/glidernet/python-ogn-client
commit
9adbe68082
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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