junzis / pyModeS

Python decoder for Mode S and ADS-B signals
GNU General Public License v3.0
527 stars 151 forks source link

Coding or comment error #142

Closed eroom1966 closed 1 year ago

eroom1966 commented 1 year ago

Hi Please take a look here https://github.com/junzis/pyModeS/blob/master/pyModeS/decoder/bds/bds40.py

lines 38 - 39

    if common.wrongstatus(d, 48, 49, 51):
        return False

these indices overlap with lines 49 - 50, for bit 51

    if common.bin2int(d[51:53]) != 0:
        return False

this also contradicts the documentation https://mode-s.org/decode/content/mode-s/9-inference.html

which says 52 - 53 | Reserved | All zeros

junzis commented 1 year ago

the code should be correct. note: python index for list starts at 0.