From 001f4956eae9d55bada4967b03e29944a161ced9 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Thu, 15 Sep 2016 15:00:10 +0100 Subject: [PATCH] faup1090: report non-A-class categories. --- net_io.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/net_io.c b/net_io.c index ea7602d..e6759ba 100644 --- a/net_io.c +++ b/net_io.c @@ -1800,6 +1800,7 @@ static void writeFATSV() int headingValid = 0; int headingMagValid = 0; int airgroundValid = 0; + int categoryValid = 0; uint64_t minAge; @@ -1827,6 +1828,7 @@ static void writeFATSV() speedValid = trackDataValidEx(&a->speed_valid, now, 15000, SOURCE_MODE_S_CHECKED); speedIASValid = trackDataValidEx(&a->speed_ias_valid, now, 15000, SOURCE_MODE_S_CHECKED); speedTASValid = trackDataValidEx(&a->speed_tas_valid, now, 15000, SOURCE_MODE_S_CHECKED); + categoryValid = trackDataValidEx(&a->category_valid, now, 15000, SOURCE_MODE_S_CHECKED); // If we are definitely on the ground, suppress any unreliable altitude info. // When on the ground, ADS-B transponders don't emit an ADS-B message that includes @@ -2014,6 +2016,15 @@ static void writeFATSV() useful = 1; } + if (categoryValid && (a->category & 0xF0) != 0xA0 && a->category_valid.updated > a->fatsv_last_emitted) { + // interesting category, not a regular aircraft + p += snprintf(p, bufsize(p,end), "\tcategory\t%02X", a->category); + if (a->category_valid.source == SOURCE_TISB) { + used_tisb = 1; + } + useful = 1; + } + // if we didn't get at least an alt or a speed or a latlon or // a heading, bail out. We don't need to do anything special // to unwind prepareWrite().