From cdc818a9f3d0a952e0d6f913f11413dffcf459ea Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Thu, 29 Jul 2021 19:04:50 +0800 Subject: [PATCH] MRAR source=5 is bogus, don't decode that. --- comm_b.c | 2 +- dump1090.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/comm_b.c b/comm_b.c index 19373c3..2cc2656 100644 --- a/comm_b.c +++ b/comm_b.c @@ -783,7 +783,7 @@ static int decodeBDS44(struct modesMessage *mm, bool store) unsigned humidity_valid = getbit(msg, 50); unsigned humidity_raw = getbits(msg, 51, 56); - if (source == MRAR_SOURCE_INVALID || source > 5) + if (source == MRAR_SOURCE_INVALID || source >= MRAR_SOURCE_RESERVED) return 0; // invalid or reserved source if (!wind_valid || !sat_valid) diff --git a/dump1090.h b/dump1090.h index 96262c4..31d48e2 100644 --- a/dump1090.h +++ b/dump1090.h @@ -244,7 +244,8 @@ typedef enum { MRAR_SOURCE_INS = 1, MRAR_SOURCE_GNSS = 2, MRAR_SOURCE_DMEDME = 3, - MRAR_SOURCE_VORDME = 4 + MRAR_SOURCE_VORDME = 4, + MRAR_SOURCE_RESERVED = 5 } mrar_source_t; // BDS4,4 and BDS4,5 hazard reports