From 8d815b7a9c3dbdeec0ef37ff1a0061ad63048786 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Fri, 7 Aug 2015 11:04:32 +0100 Subject: [PATCH] faup1090 accepts/requires --stdout --- faup1090.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/faup1090.c b/faup1090.c index 67a3fb7..8e21068 100644 --- a/faup1090.c +++ b/faup1090.c @@ -1,6 +1,6 @@ // Part of dump1090, a Mode S message decoder for RTLSDR devices. // -// faup1090.c: cut down version that just does 30005 -> 10001 forwarding +// faup1090.c: cut down version that just does 30005 -> stdout forwarding // // Copyright (c) 2014,2015 Oliver Jowett // @@ -113,6 +113,7 @@ static 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" +"--stdout REQUIRED. Write results to stdout.\n" "--help Show this help\n" "\n", MODES_DUMP1090_VARIANT " " MODES_DUMP1090_VERSION @@ -137,6 +138,7 @@ static void backgroundTasks(void) { // int main(int argc, char **argv) { int j; + int stdout_option = 0; char *bo_connect_ipaddr = "127.0.0.1"; int bo_connect_port = MODES_NET_OUTPUT_BEAST_PORT; struct client *c; @@ -162,6 +164,8 @@ int main(int argc, char **argv) { } else if (!strcmp(argv[j],"--help")) { showHelp(); exit(0); + } else if (!strcmp(argv[j],"--stdout")) { + stdout_option = 1; } else { fprintf(stderr, "Unknown or not enough arguments for option '%s'.\n\n", @@ -171,6 +175,13 @@ int main(int argc, char **argv) { } } + if (!stdout_option) { + fprintf(stderr, + "--stdout is required, output always goes to stdout.\n"); + showHelp(); + exit(1); + } + // Initialization faupInit(); modesInitNet();