From f1036702ce7fa40ea58a8949cca7bd6b2a63f412 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Thu, 22 Feb 2018 07:42:22 +0000 Subject: [PATCH] Use the time we last saw a message for data validity checks / data age info, rather than the time we eventually decide to emit it. --- net_io.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net_io.c b/net_io.c index d86a91e..84a006d 100644 --- a/net_io.c +++ b/net_io.c @@ -2038,8 +2038,6 @@ static void writeFATSV() // scan once a second at most next_update = now + 1000; - // Pretend we are "processing a message" so the validity checks work as expected - _messageNow = now; for (a = Modes.aircrafts; a; a = a->next) { if (a->messages < 2) // basic filter for bad decodes continue; @@ -2049,6 +2047,9 @@ static void writeFATSV() continue; } + // Pretend we are "processing a message" so the validity checks work as expected + _messageNow = a->seen; + // some special cases: int altValid = trackDataValid(&a->altitude_baro_valid); int airgroundValid = trackDataValid(&a->airground_valid) && a->airground_valid.source >= SOURCE_MODE_S_CHECKED; // for non-ADS-B transponders, only trust DF11 CA field