From 769169d72249cbdd8a5f032fd64f08474dad1c14 Mon Sep 17 00:00:00 2001 From: AvSquirrel Date: Sun, 28 Feb 2016 01:33:27 +0000 Subject: [PATCH] Revise dump1090 for CA/CF reporting. Clean up demo traffic type identification. --- dump1090 | 2 +- main/traffic.go | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/dump1090 b/dump1090 index 6a9c94fd..9a4fb850 160000 --- a/dump1090 +++ b/dump1090 @@ -1 +1 @@ -Subproject commit 6a9c94fd256a373a73fbc1d46f6c19d54525f2ea +Subproject commit 9a4fb850937565cfeadd1e5889cddbf93f45faf5 diff --git a/main/traffic.go b/main/traffic.go index a7b8928e..51358605 100644 --- a/main/traffic.go +++ b/main/traffic.go @@ -841,19 +841,22 @@ func updateDemoTraffic(icao uint32, tail string, relAlt float32, gs float64, off ti.Icao_addr = icao ti.OnGround = false - ti.Addr_type = uint8(icao % 4) // 0 == ADS-B; 1 == reserved; 2 == TIS-B with ICAO address; 3 == TIS-B without ICAO address. - if ti.Addr_type == 1 { //reserved value - ti.Addr_type = 0 + ti.Addr_type = uint8(icao % 4) // 0 == ADS-B; 1 == reserved; 2 == TIS-B with ICAO address; 3 == TIS-B without ICAO address; 6 == ADS-R + if ti.Addr_type == 1 { // reassign "reserved value" to ADS-R + ti.Addr_type = 6 } if ti.Addr_type == 0 { ti.TargetType = TARGET_TYPE_ADSB - } - if ti.Addr_type == 2 { - ti.TargetType = TARGET_TYPE_ADSR - } - if ti.Addr_type == 3 { + } else if ti.Addr_type == 3 { ti.TargetType = TARGET_TYPE_TISB + } else if ti.Addr_type == 6 { + ti.TargetType = TARGET_TYPE_ADSR + } else if ti.Addr_type == 2 { + ti.TargetType = TARGET_TYPE_TISB_S + if (ti.NIC >= 7) && (ti.Emitter_category > 0) { // If NIC is sufficiently high and emitter type is transmitted, we'll assume it's ADS-R. + ti.TargetType = TARGET_TYPE_ADSR + } } ti.Emitter_category = 1