From 8879bcac869f816b89752e1a557833047befa8a0 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Sat, 2 May 2020 14:53:30 +0800 Subject: [PATCH] Change 2-bit correction option to "--fix-2bit" --fix --fix was a poor choice for this, as some existing configs happened to specify --fix twice but only expected 1-bit correction. So move 2-bit correction to a separate option. "--fix" or "--fix --fix" now gives 1-bit correction. "--fix-2bit" or "--fix --fix-2bit" or "--fix-2bit --fix" gives 2-bit correction. Version bump to 3.8.2~dev --- debian/changelog | 9 +++++++++ dump1090.c | 9 ++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9d20356..0244410 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +dump1090-fa (3.8.2~dev) UNRELEASED; urgency=medium + + * in development + * --fix --fix was a bad choice for 2-bit correction since some existing configs + accidentally specified it twice anyway. Change 2-bit correction to a separate + option, --fix-2bit + + -- Oliver Jowett Sat, 02 May 2020 14:50:25 +0800 + dump1090-fa (3.8.1) stable; urgency=medium * SkyAware: Fixed SkyAware banner aspect ratio diff --git a/dump1090.c b/dump1090.c index 2506e8c..2b5c4dc 100644 --- a/dump1090.c +++ b/dump1090.c @@ -309,8 +309,8 @@ void showHelp(void) { "--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" -"--fix Enable single-bits error correction using CRC\n" -" (specify twice for two-bit error correction)\n" +"--fix Enable single-bit error correction using CRC\n" +"--fix-2bit Enable two-bit error correction using CRC (use with caution)\n" "--no-fix Disable error correction using CRC\n" "--no-crc-check Disable messages with broken CRC (discouraged)\n" "--mlat display raw messages in Beast ascii mode\n" @@ -481,7 +481,10 @@ int main(int argc, char **argv) { } else if (!strcmp(argv[j],"--measure-noise")) { // Ignored } else if (!strcmp(argv[j],"--fix")) { - ++Modes.nfix_crc; + if (Modes.nfix_crc < 1) + Modes.nfix_crc = 1; + } else if (!strcmp(argv[j],"--fix-2bit")) { + Modes.nfix_crc = 2; } else if (!strcmp(argv[j],"--no-fix")) { Modes.nfix_crc = 0; } else if (!strcmp(argv[j],"--no-crc-check")) {