From de4e233969d648bacc972e5c1429ecfe2a55b5d9 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Mon, 29 Jun 2015 12:45:50 +0100 Subject: [PATCH] When considering whether to suppress altitude messages, ignore mlat DF17s. --- track.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/track.c b/track.c index d1bdffb..8cfbc1f 100644 --- a/track.c +++ b/track.c @@ -508,12 +508,12 @@ struct aircraft *trackUpdateFromMessage(struct modesMessage *mm) a->modeACflags &= ~MODEAC_MSG_MODEC_HIT; } - // If we received an altitude in a DF17/18 squitter recently, ignore + // If we received an altitude in a (non-mlat) DF17/18 squitter recently, ignore // DF0/4/16/20 altitudes as single-bit errors can attribute them to the wrong // aircraft - if ((a->bFlags & MODES_ACFLAGS_ALTITUDE_VALID) && + if ((a->bFlags & ~a->mlatFlags & MODES_ACFLAGS_ALTITUDE_VALID) && (now - a->seenAltitude) < 15000 && - (a->bFlags & MODES_ACFLAGS_LATLON_VALID) && + (a->bFlags & ~a->mlatFlags & MODES_ACFLAGS_LATLON_VALID) && (now - a->seenLatLon) < 15000 && mm->msgtype != 17 && mm->msgtype != 18) {