diff --git a/dump1090.c b/dump1090.c index 756ba7a..6b9a4e3 100644 --- a/dump1090.c +++ b/dump1090.c @@ -694,6 +694,7 @@ void showHelp(void) { "--net-heartbeat TCP heartbeat rate in seconds (default: 60 sec; 0 to disable)\n" "--net-buffer TCP buffer size 64Kb * (2^n) (default: n=0, 64Kb)\n" "--net-verbatim Do not apply CRC corrections to messages we forward; send unchanged\n" +"--forward-mlat Allow forwarding of received mlat results to output ports\n" "--lat Reference/receiver latitude for surface posn (opt)\n" "--lon Reference/receiver longitude for surface posn (opt)\n" "--max-range Absolute maximum range for position decoding (in nm, default: 300)\n" @@ -994,6 +995,8 @@ int main(int argc, char **argv) { Modes.net_sndbuf_size = atoi(argv[++j]); } else if (!strcmp(argv[j],"--net-verbatim")) { Modes.net_verbatim = 1; + } else if (!strcmp(argv[j],"--forward-mlat")) { + Modes.forward_mlat = 1; } else if (!strcmp(argv[j],"--onlyaddr")) { Modes.onlyaddr = 1; } else if (!strcmp(argv[j],"--metric")) { diff --git a/dump1090.h b/dump1090.h index f57b6f1..fc65b4e 100644 --- a/dump1090.h +++ b/dump1090.h @@ -309,6 +309,7 @@ struct { // Internal state int net_fatsv_port; // FlightAware TSV port int net_sndbuf_size; // TCP output buffer size (64Kb * 2^n) int net_verbatim; // if true, send the original message, not the CRC-corrected one + int forward_mlat; // allow forwarding of mlat messages to output ports int quiet; // Suppress stdout uint32_t show_only; // Only show messages from this ICAO int interactive; // Interactive mode diff --git a/net_io.c b/net_io.c index 5031cc6..26601f4 100644 --- a/net_io.c +++ b/net_io.c @@ -637,6 +637,9 @@ static void send_sbs_heartbeat(struct net_service *service) //========================================================================= // void modesQueueOutput(struct modesMessage *mm) { + if ((mm->bFlags & MODES_ACFLAGS_FROM_MLAT) && !Modes.forward_mlat) + return; + modesSendSBSOutput(mm); modesSendBeastOutput(mm); modesSendRawOutput(mm);