Changed my mind, put the non-ICAO flag bit in the address itself

since we have 8 bits spare, so there's no chance of confusing it
with an ICAO address, and we can safely use the filter table to match
future messages without also matching equivalent ICAO addresses.
This commit is contained in:
Oliver Jowett 2015-01-22 12:30:12 +00:00
parent 35551b4455
commit ada188a1c8
5 changed files with 14 additions and 14 deletions

View file

@ -545,8 +545,9 @@ int decodeModesMessage(struct modesMessage *mm, unsigned char *msg)
mm->addr = (msg[1] << 16) | (msg[2] << 8) | (msg[3]);
if (mm->msgtype == 18 && (mm->cf != 0 && mm->cf != 6))
mm->bFlags |= MODES_ACFLAGS_NON_ICAO; // DF 18 message not using ICAO addressing
else if (!mm->correctedbits && (mm->msgtype != 11 || mm->iid == 0)) {
mm->addr |= MODES_NON_ICAO_ADDRESS; // don't confuse this with any ICAO address
if (!mm->correctedbits && (mm->msgtype != 11 || mm->iid == 0)) {
// No CRC errors seen, and either it was an DF17/18 extended squitter
// or a DF11 acquisition squitter with II = 0. We probably have the right address.