diff --git a/dump1090.c b/dump1090.c index 9334581..2506e8c 100644 --- a/dump1090.c +++ b/dump1090.c @@ -310,11 +310,9 @@ void showHelp(void) { "--lon Reference/receiver longitude for surface posn (opt)\n" "--max-range Absolute maximum range for position decoding (in nm, default: 300)\n" "--fix Enable single-bits error correction using CRC\n" -"--no-fix Disable single-bits error correction using CRC\n" +" (specify twice for two-bit error correction)\n" +"--no-fix Disable error correction using CRC\n" "--no-crc-check Disable messages with broken CRC (discouraged)\n" -#ifdef ALLOW_AGGRESSIVE -"--aggressive More CPU for more messages (two bits fixes, ...)\n" -#endif "--mlat display raw messages in Beast ascii mode\n" "--stats With --ifile print stats at exit. No other output\n" "--stats-range Collect/show range histogram\n" @@ -483,7 +481,7 @@ int main(int argc, char **argv) { } else if (!strcmp(argv[j],"--measure-noise")) { // Ignored } else if (!strcmp(argv[j],"--fix")) { - Modes.nfix_crc = 1; + ++Modes.nfix_crc; } else if (!strcmp(argv[j],"--no-fix")) { Modes.nfix_crc = 0; } else if (!strcmp(argv[j],"--no-crc-check")) { @@ -547,11 +545,7 @@ int main(int argc, char **argv) { } else if (!strcmp(argv[j],"--hae") || !strcmp(argv[j],"--gnss")) { Modes.use_gnss = 1; } else if (!strcmp(argv[j],"--aggressive")) { -#ifdef ALLOW_AGGRESSIVE - Modes.nfix_crc = MODES_MAX_BITERRORS; -#else - fprintf(stderr, "warning: --aggressive not supported in this build, option ignored.\n"); -#endif + fprintf(stderr, "warning: --aggressive not supported in this build, option ignored (consider '--fix --fix' instead)\n"); } else if (!strcmp(argv[j],"--interactive")) { Modes.interactive = 1; } else if (!strcmp(argv[j],"--interactive-ttl") && more) { @@ -627,6 +621,9 @@ int main(int argc, char **argv) { if (!Modes.quiet) {showCopyright();} #endif + if (Modes.nfix_crc > MODES_MAX_BITERRORS) + Modes.nfix_crc = MODES_MAX_BITERRORS; + // Initialization log_with_timestamp("%s %s starting up.", MODES_DUMP1090_VARIANT, MODES_DUMP1090_VERSION); modesInit(); diff --git a/view1090.c b/view1090.c index 590d904..f1522a9 100644 --- a/view1090.c +++ b/view1090.c @@ -120,9 +120,9 @@ void showHelp(void) { "--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" - "--aggressive More CPU for more messages (two bits fixes, ...)\n" + " (specify twice for two-bit error correction)\n" + "--no-fix Disable error correction using CRC\n" "--metric Use metric units (meters, km/h, ...)\n" "--show-only Show only messages from the given ICAO on stdout\n" "--help Show this help\n", @@ -171,11 +171,9 @@ int main(int argc, char **argv) { } else if (!strcmp(argv[j],"--no-crc-check")) { Modes.check_crc = 0; } else if (!strcmp(argv[j],"--fix")) { - Modes.nfix_crc = 1; + ++Modes.nfix_crc; } else if (!strcmp(argv[j],"--no-fix")) { 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")) { @@ -194,6 +192,9 @@ int main(int argc, char **argv) { #define MSG_DONTWAIT 0 #endif + if (Modes.nfix_crc > MODES_MAX_BITERRORS) + Modes.nfix_crc = MODES_MAX_BITERRORS; + // Initialization view1090Init(); modesInitNet();