Fix aircraft_type decoding and add no-tracking flag decoding for Ogn & Flarm parsers

pull/95/head
tfraudet 2021-03-14 22:21:38 +01:00 zatwierdzone przez Konstantin Gründger
rodzic f11e0efa97
commit 8fef35830e
2 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -16,7 +16,8 @@ class FlarmParser(BaseParser):
if match.group('details'):
result.update({
'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,
'address': match.group('address'),
})

Wyświetl plik

@ -34,7 +34,8 @@ class OgnParser(BaseParser):
if match.group('details'):
result.update({
'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,
'address': match.group('address'),
})