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.
This commit is contained in:
Oliver Jowett 2018-02-22 07:42:22 +00:00
parent a256833e17
commit f1036702ce

View file

@ -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