From a910454c025db2a697f1022ed36c9513f40ad4eb Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Fri, 26 Aug 2016 11:33:36 +0100 Subject: [PATCH] Comm-D ELM is actually DF 24..31, not just 24. This DF is formatted with the first two bits as 1, and the next 3 bits are part of the message rather than part of the DF code. So effectively it spans 8 DF values if you are looking at the full 5 bits. --- mode_s.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mode_s.c b/mode_s.c index 7563a31..574cb0f 100644 --- a/mode_s.c +++ b/mode_s.c @@ -355,6 +355,13 @@ int scoreModesMessage(unsigned char *msg, int validbits) case 5: // surveillance, altitude reply case 16: // long air-air surveillance case 24: // Comm-D (ELM) + case 25: // Comm-D (ELM) + case 26: // Comm-D (ELM) + case 27: // Comm-D (ELM) + case 28: // Comm-D (ELM) + case 29: // Comm-D (ELM) + case 30: // Comm-D (ELM) + case 31: // Comm-D (ELM) return icaoFilterTest(crc) ? 1000 : -1; case 11: // All-call reply @@ -462,6 +469,13 @@ int decodeModesMessage(struct modesMessage *mm, unsigned char *msg) case 5: // surveillance, altitude reply case 16: // long air-air surveillance case 24: // Comm-D (ELM) + case 25: // Comm-D (ELM) + case 26: // Comm-D (ELM) + case 27: // Comm-D (ELM) + case 28: // Comm-D (ELM) + case 29: // Comm-D (ELM) + case 30: // Comm-D (ELM) + case 31: // Comm-D (ELM) // These message types use Address/Parity, i.e. our CRC syndrome is the sender's ICAO address. // We can't tell if the CRC is correct or not as we don't know the correct address. // Accept the message if it appears to be from a previously-seen aircraft