From 568e843b9f6dddd7957aa2935dfe1e2d49a91389 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Fri, 26 Aug 2016 11:29:42 +0100 Subject: [PATCH] Add --max-range to view1090, use the same defaults as dump1090. --- view1090.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/view1090.c b/view1090.c index 432fc32..3b26d05 100644 --- a/view1090.c +++ b/view1090.c @@ -69,6 +69,7 @@ void view1090InitConfig(void) { Modes.interactive_rows = getTermRows(); Modes.interactive_display_ttl = MODES_INTERACTIVE_DISPLAY_TTL; Modes.interactive = 1; + Modes.maxRange = 1852 * 300; // 300NM default max range } // //========================================================================= @@ -130,6 +131,7 @@ void showHelp(void) { "--net-bo-port TCP Beast output listen port (default: 30005)\n" "--lat Reference/receiver latitide 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" "--no-crc-check Disable messages with broken CRC (discouraged)\n" "--no-fix Disable single-bits error correction using CRC\n" "--fix Enable single-bits error correction using CRC\n" @@ -192,6 +194,8 @@ int main(int argc, char **argv) { Modes.nfix_crc = 0; } else if (!strcmp(argv[j],"--aggressive")) { Modes.nfix_crc = MODES_MAX_BITERRORS; + } else if (!strcmp(argv[j],"--max-range") && more) { + Modes.maxRange = atof(argv[++j]) * 1852.0; // convert to metres } else if (!strcmp(argv[j],"--help")) { showHelp(); exit(0);