From 48986c48cc4410e487d3d0759be5b3c6ea2d9431 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Sat, 27 Dec 2014 20:11:10 +0000 Subject: [PATCH] Remove half-implemented --no-decode option. --- debian/changelog | 6 ++++++ dump1090.c | 25 ------------------------- dump1090.h | 1 - mode_s.c | 14 +------------- 4 files changed, 7 insertions(+), 39 deletions(-) diff --git a/debian/changelog b/debian/changelog index ac2b9dd..93087f4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dump1090-mutability (1.08.2302.14+1mu-4) UNRELEASED; urgency=medium + + * Remove half-implemented --no-decode option. + + -- Oliver Jowett Sat, 27 Dec 2014 20:08:44 +0000 + dump1090-mutability (1.08.2302.14+1mu-3) unstable; urgency=medium * Ask about json interval before json dir and skip the dir question if diff --git a/dump1090.c b/dump1090.c index 619423a..d1b03e5 100644 --- a/dump1090.c +++ b/dump1090.c @@ -830,8 +830,6 @@ int main(int argc, char **argv) { } else if (!strcmp(argv[j],"--interactive-rtl1090")) { Modes.interactive = 1; Modes.interactive_rtl1090 = 1; - } else if (!strcmp(argv[j],"--no-decode")) { - Modes.no_decode = 1; } else if (!strcmp(argv[j],"--oversample")) { Modes.oversample = 1; fprintf(stderr, "Oversampling enabled. Be very afraid.\n"); @@ -857,29 +855,6 @@ int main(int argc, char **argv) { } } - // Handle --no-decode, which turns off various parts of decoding - // that are not useful for an "edge" dump1090 that purely forwards - // raw data to a central hub elsewhere. - if (Modes.no_decode) { - if (Modes.interactive) { - fprintf(stderr, "--no-decode and --interactive cannot be specified together.\n"); - exit(1); - } - - if (Modes.net_output_sbs_port != MODES_NET_OUTPUT_SBS_PORT) { - fprintf(stderr, "--no-decode and --net-sbs-port cannot be specified together.\n"); - exit(1); - } - - if (Modes.net_http_port != MODES_NET_HTTP_PORT) { - fprintf(stderr, "--no-decode and --net-http-port cannot be specified together.\n"); - exit(1); - } - - Modes.net_output_sbs_port = 0; - Modes.net_http_port = 0; - } - #ifdef _WIN32 // Try to comply with the Copyright license conditions for binary distribution if (!Modes.quiet) {showCopyright();} diff --git a/dump1090.h b/dump1090.h index 909cf68..d6df114 100644 --- a/dump1090.h +++ b/dump1090.h @@ -368,7 +368,6 @@ struct { // Internal state int metric; // Use metric units int mlat; // Use Beast ascii format for raw data output, i.e. @...; iso *...; int interactive_rtl1090; // flight table in interactive mode is formatted like RTL1090 - int no_decode; // Disable decoding and aircraft tracking char *json_aircraft_path; // Path to json aircraft file to write, or NULL not to. char *json_metadata_path; // Path to json metadata file to write, or NULL not to. int json_interval; // Interval between rewriting the json aircraft file diff --git a/mode_s.c b/mode_s.c index 5c0b0e6..088da82 100644 --- a/mode_s.c +++ b/mode_s.c @@ -911,9 +911,6 @@ void decodeModesMessage(struct modesMessage *mm, unsigned char *msg) { // of the data contents, so save time and give up now. if ((Modes.check_crc) && (!mm->crcok) && (!mm->correctedbits)) { return;} - // If decoding is disabled, this is as far as we go. - if (Modes.no_decode) return; - // Fields for DF0, DF16 if (mm->msgtype == 0 || mm->msgtype == 16) { if (msg[0] & 0x04) { // VS Bit @@ -1184,12 +1181,6 @@ void displayModesMessage(struct modesMessage *mm) { if (mm->timestampMsg) printf("Time: %.2fus (phase: %d)\n", mm->timestampMsg / 12.0, (unsigned int) (360 * (mm->timestampMsg % 6) / 6)); - if (Modes.no_decode) { - // Show DF type and address only; the rest is not decoded. - printf("DF %d; address: %06x\n", mm->msgtype, mm->addr); - return; - } - if (mm->msgtype == 0) { // DF 0 printf("DF 0: Short Air-Air Surveillance.\n"); printf(" VS : %s\n", (mm->msg[0] & 0x04) ? "Ground" : "Airborne"); @@ -2381,11 +2372,8 @@ void detectModeS_oversample(uint16_t *m, uint32_t mlen) { // void useModesMessage(struct modesMessage *mm) { if ((Modes.check_crc == 0) || (mm->crcok) || (mm->correctedbits)) { // not checking, ok or fixed - // If we are decoding, track aircraft - if (!Modes.no_decode) { - interactiveReceiveData(mm); - } + interactiveReceiveData(mm); // In non-interactive non-quiet mode, display messages on standard output if (!Modes.interactive && !Modes.quiet) {