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

@ -364,14 +364,12 @@ void decodeModeAMessage(struct modesMessage *mm, int ModeA)
mm->msg[0] = (ModeA >> 8);
mm->msg[1] = (ModeA);
// Fudge an ICAO address based on Mode A (remove the Ident bit)
// Use an upper address byte of FF, since this is ICAO unallocated
mm->addr = 0x00FF0000 | (ModeA & 0x0000FF7F);
// Fudge an address based on Mode A (remove the Ident bit)
mm->addr = (ModeA & 0x0000FF7F) | MODES_NON_ICAO_ADDRESS;
// Set the Identity field to ModeA
mm->modeA = ModeA & 0x7777;
mm->bFlags |= MODES_ACFLAGS_SQUAWK_VALID;
mm->bFlags |= MODES_ACFLAGS_NON_ICAO;
// Flag ident in flight status
mm->fs = ModeA & 0x0080;