Flag non-ICAO addresses, display them differently in interactive mode.

This commit is contained in:
Oliver Jowett 2015-01-22 11:14:22 +00:00
parent 34ae2c7349
commit 9a91507583
4 changed files with 9 additions and 3 deletions

View file

@ -543,7 +543,10 @@ int decodeModesMessage(struct modesMessage *mm, unsigned char *msg)
// AA (Address announced)
if (mm->msgtype == 11 || mm->msgtype == 17 || mm->msgtype == 18) {
mm->addr = (msg[1] << 16) | (msg[2] << 8) | (msg[3]);
if (!mm->correctedbits && (mm->msgtype != 11 || mm->iid == 0)) {
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)) {
// 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.