From c3976f1ca3bd0c6b53c67ff6f68214eeac4cbafa Mon Sep 17 00:00:00 2001 From: Junzi Sun Date: Fri, 16 Oct 2020 22:32:03 +0200 Subject: [PATCH] update cap17() --- pyModeS/decoder/bds/bds17.py | 10 +++------- pyModeS/decoder/bds/bds40.py | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/pyModeS/decoder/bds/bds17.py b/pyModeS/decoder/bds/bds17.py index cb5270a..80210f1 100644 --- a/pyModeS/decoder/bds/bds17.py +++ b/pyModeS/decoder/bds/bds17.py @@ -21,7 +21,7 @@ def is17(msg): d = common.hex2bin(common.data(msg)) - if common.bin2int(d[28:56]) != 0: + if common.bin2int(d[24:56]) != 0: return False caps = cap17(msg) @@ -72,14 +72,10 @@ def cap17(msg): "56", "5F", "60", - "NA", - "NA", - "E1", - "E2", ] d = common.hex2bin(common.data(msg)) - idx = [i for i, v in enumerate(d[:28]) if v == "1"] - capacity = ["BDS" + allbds[i] for i in idx if allbds[i] is not "NA"] + idx = [i for i, v in enumerate(d[:24]) if v == "1"] + capacity = ["BDS" + allbds[i] for i in idx] return capacity diff --git a/pyModeS/decoder/bds/bds40.py b/pyModeS/decoder/bds/bds40.py index bc4950e..5a145e7 100644 --- a/pyModeS/decoder/bds/bds40.py +++ b/pyModeS/decoder/bds/bds40.py @@ -117,4 +117,4 @@ def alt40fms(msg): "alt40fms() has been renamed to selalt40fms(). It will be removed in the future.", DeprecationWarning, ) - return selalt40mcp(msg) + return selalt40fms(msg)