From 0e29a4d18a0b477c9761fddb5030200430ede7d2 Mon Sep 17 00:00:00 2001 From: junzis Date: Fri, 21 Jul 2017 15:57:32 +0200 Subject: [PATCH] minor update --- pyModeS/adsb.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyModeS/adsb.py b/pyModeS/adsb.py index b2ddb19..d98a04a 100644 --- a/pyModeS/adsb.py +++ b/pyModeS/adsb.py @@ -679,4 +679,8 @@ def altitude_diff(msg): msgbin = util.hex2bin(msg) sign = -1 if int(msgbin[80]) else 1 value = util.bin2int(msgbin[81:88]) * 25 - return sign * value + + if value == 0 or value == 127: + return None + else: + return sign * value