Mlat synthetic message detection.

Notice synthetic mlat messages by looking for messages with a magic
timestamp value. If they arrive, tag the derived data as mlat-derived.

Don't include mlat-derived output in FATSV output to avoid loops.
This commit is contained in:
Oliver Jowett 2015-06-28 20:04:09 +01:00
parent 8f08c1b87f
commit 12a7d45e75
6 changed files with 33 additions and 7 deletions

View file

@ -535,6 +535,13 @@ struct aircraft *trackUpdateFromMessage(struct modesMessage *mm)
// Update the aircrafts a->bFlags to reflect the newly received mm->bFlags;
a->bFlags |= mm->bFlags;
// Update mlat flags. The mlat flags indicate which bits in bFlags
// were last set based on a mlat-derived message.
if (mm->bFlags & MODES_ACFLAGS_FROM_MLAT)
a->mlatFlags = (a->mlatFlags & a->bFlags) | mm->bFlags;
else
a->mlatFlags = (a->mlatFlags & a->bFlags) & ~mm->bFlags;
if (mm->msgtype == 32) {
int flags = a->modeACflags;
if ((flags & (MODEAC_MSG_MODEC_HIT | MODEAC_MSG_MODEC_OLD)) == MODEAC_MSG_MODEC_OLD) {