fix DF4,20 altitude decoding
This commit is contained in:
@@ -101,8 +101,8 @@ def altcode(msg):
|
|||||||
B4 = mbin[30]
|
B4 = mbin[30]
|
||||||
D4 = mbin[31]
|
D4 = mbin[31]
|
||||||
|
|
||||||
greystr = D2 + D4 + A1 + A2 + A4 + B1 + B2 + B4 + C1 + C2 + C4
|
graystr = D2 + D4 + A1 + A2 + A4 + B1 + B2 + B4 + C1 + C2 + C4
|
||||||
alt = grey2alt(greystr)
|
alt = gray2alt(graystr)
|
||||||
|
|
||||||
if mbit == '1': # unit in meter
|
if mbit == '1': # unit in meter
|
||||||
vbin = mbin[19:25] + mbin[26:31]
|
vbin = mbin[19:25] + mbin[26:31]
|
||||||
@@ -110,7 +110,7 @@ def altcode(msg):
|
|||||||
|
|
||||||
return alt
|
return alt
|
||||||
|
|
||||||
def grey2alt(codestr):
|
def gray2alt(codestr):
|
||||||
gc500 = codestr[:8]
|
gc500 = codestr[:8]
|
||||||
n500 = util.gray2int(gc500)
|
n500 = util.gray2int(gc500)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user