kopia lustrzana https://github.com/glidernet/python-ogn-client
Fix aircraft_type decoding and add no-tracking flag decoding for Ogn & Flarm parsers
rodzic
f11e0efa97
commit
8fef35830e
|
@ -16,7 +16,8 @@ class FlarmParser(BaseParser):
|
||||||
if match.group('details'):
|
if match.group('details'):
|
||||||
result.update({
|
result.update({
|
||||||
'address_type': int(match.group('details'), 16) & 0b00000011,
|
'address_type': int(match.group('details'), 16) & 0b00000011,
|
||||||
'aircraft_type': (int(match.group('details'), 16) & 0b01111100) >> 2,
|
'aircraft_type': (int(match.group('details'), 16) & 0b00111100) >> 2,
|
||||||
|
'no-tracking': (int(match.group('details'), 16) & 0b01000000) >> 6 == 1,
|
||||||
'stealth': (int(match.group('details'), 16) & 0b10000000) >> 7 == 1,
|
'stealth': (int(match.group('details'), 16) & 0b10000000) >> 7 == 1,
|
||||||
'address': match.group('address'),
|
'address': match.group('address'),
|
||||||
})
|
})
|
||||||
|
|
|
@ -34,7 +34,8 @@ class OgnParser(BaseParser):
|
||||||
if match.group('details'):
|
if match.group('details'):
|
||||||
result.update({
|
result.update({
|
||||||
'address_type': int(match.group('details'), 16) & 0b00000011,
|
'address_type': int(match.group('details'), 16) & 0b00000011,
|
||||||
'aircraft_type': (int(match.group('details'), 16) & 0b01111100) >> 2,
|
'aircraft_type': (int(match.group('details'), 16) & 0b00111100) >> 2,
|
||||||
|
'no-tracking': (int(match.group('details'), 16) & 0b01000000) >> 6 == 1,
|
||||||
'stealth': (int(match.group('details'), 16) & 0b10000000) >> 7 == 1,
|
'stealth': (int(match.group('details'), 16) & 0b10000000) >> 7 == 1,
|
||||||
'address': match.group('address'),
|
'address': match.group('address'),
|
||||||
})
|
})
|
||||||
|
|
Ładowanie…
Reference in New Issue