diff --git a/help.h b/help.h index e60329be..17fae3bd 100644 --- a/help.h +++ b/help.h @@ -144,6 +144,7 @@ static struct argp_option optionsReadsb[] = { {"tar1090-use-api", OptTar1090UseApi, 0, 0, "when running with globe-index, signal tar1090 use the readsb API to get data, requires webserver mapping of /tar1090/re-api to proxy_pass the requests to the --net-api-port, see nginx-readsb-api.conf in the tar1090 repository for details", 2}, {"net-beast-reduce-out-port", OptNetBeastReducePorts, "", 0, "TCP BeastReduce output listen ports (default: 0)", 2}, {"net-beast-reduce-interval", OptNetBeastReduceInterval, "", 0, "BeastReduce data update interval, longer means less data (default: 0.250, valid range: 0.000 - 14.999)", 2}, + {"net-beast-reduce-optimize-for-mlat", OptNetBeastReduceOptimizeMlat, 0, 0, "BeastReduce output: keep all messages relevant to mlat-client", 2}, {"net-beast-reduce-filter-dist", OptNetBeastReduceFilterDist, "", 0, "beast-reduce: remove aircraft which are further than distance from the receiver", 2}, {"net-beast-reduce-filter-alt", OptNetBeastReduceFilterAlt, "", 0, "beast-reduce: remove aircraft which are above altitude", 2}, {"net-sbs-reduce", OptNetSbsReduce, 0, 0, "Apply beast reduce logic and interval to SBS outputs", 2}, diff --git a/readsb.c b/readsb.c index 78862c63..8ccd8872 100644 --- a/readsb.c +++ b/readsb.c @@ -1746,6 +1746,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) { if (atof(arg) > 0) Modes.beast_reduce_filter_distance = (float) atof(arg) * 1852.0f; // convert to meters break; + case OptNetBeastReduceOptimizeMlat: + Modes.beast_reduce_optimize_mlat = 1; + break; case OptNetBeastReduceInterval: if (atof(arg) >= 0) Modes.net_output_beast_reduce_interval = (int64_t) (1000 * atof(arg)); diff --git a/readsb.h b/readsb.h index 246fd09b..cc37946f 100644 --- a/readsb.h +++ b/readsb.h @@ -709,6 +709,7 @@ struct _Modes int8_t viewadsb; int8_t sbsReduce; // apply beast reduce logic to SBS messages int8_t asterixReduce; // apply beast reduce logic to SBS messages + int8_t beast_reduce_optimize_mlat; // keep all messages relevant to mlat-client (best-effort) int position_persistence; // Maximum number of consecutive implausible positions from global CPR to invalidate a known position int json_reliable; @@ -1217,6 +1218,7 @@ enum { OptNetAsterixReduce, OptNetBeastReducePorts, OptNetBeastReduceInterval, + OptNetBeastReduceOptimizeMlat, OptNetBeastReduceFilterAlt, OptNetBeastReduceFilterDist, OptNetSbsReduce, diff --git a/track.c b/track.c index 2585dad3..4a8f761c 100644 --- a/track.c +++ b/track.c @@ -2302,6 +2302,11 @@ struct aircraft *trackUpdateFromMessage(struct modesMessage *mm) { } + if (Modes.beast_reduce_optimize_mlat) { + if (mm->cpr_valid || a->position_valid.source < SOURCE_ADSR) { + mm->reduce_forward = 1; + } + } if (mm->acas_ra_valid) {