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.
This commit is contained in:
Oliver Jowett 2016-08-26 11:33:36 +01:00
parent 308b928f8c
commit a910454c02

View file

@ -355,6 +355,13 @@ int scoreModesMessage(unsigned char *msg, int validbits)
case 5: // surveillance, altitude reply case 5: // surveillance, altitude reply
case 16: // long air-air surveillance case 16: // long air-air surveillance
case 24: // Comm-D (ELM) 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; return icaoFilterTest(crc) ? 1000 : -1;
case 11: // All-call reply case 11: // All-call reply
@ -462,6 +469,13 @@ int decodeModesMessage(struct modesMessage *mm, unsigned char *msg)
case 5: // surveillance, altitude reply case 5: // surveillance, altitude reply
case 16: // long air-air surveillance case 16: // long air-air surveillance
case 24: // Comm-D (ELM) 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. // 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. // 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 // Accept the message if it appears to be from a previously-seen aircraft