diff options
author | etobi <git@e-tobi.net> | 2013-09-03 09:48:41 +0200 |
---|---|---|
committer | etobi <git@e-tobi.net> | 2013-09-03 09:48:41 +0200 |
commit | ab959d7b4194715870128e616b8e29d4a101e488 (patch) | |
tree | 61a746231d30817be73416a7d67763fd677a1042 /test/diseqc.c | |
parent | 6b350466c4902c5b137e0efaf1d189128a7f18f5 (diff) | |
download | linux-dvb-apps-ab959d7b4194715870128e616b8e29d4a101e488.tar.gz |
Imported Upstream version 1.1.1+rev1207upstream/1.1.1+rev1207
Diffstat (limited to '')
-rw-r--r-- | test/diseqc.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/test/diseqc.c b/test/diseqc.c index 8f2e411..5deb7fe 100644 --- a/test/diseqc.c +++ b/test/diseqc.c @@ -1,11 +1,13 @@ -/* - * Test sending DiSEqC commands on a SAT frontend. - * - * usage: FRONTEND=/dev/dvb/adapterX/frontendX diseqc [test_seq_no] - */ +#define USAGE \ +"\n" \ +"\nTest sending DiSEqC commands on a SAT frontend." \ +"\n" \ +"\nusage: FRONTEND=/dev/dvb/adapterX/frontendX diseqc [test_seq_no|'all']" \ +"\n" #include <pthread.h> #include <time.h> +#include <string.h> #include <stdlib.h> #include <stdint.h> #include <stdio.h> @@ -109,7 +111,10 @@ int main(int argc, char **argv) return -1; } - if (argc > 1) { + if (argc != 2) { + fprintf (stderr, "usage: %s [number|'all']\n" USAGE, argv[0]); + return 1; + } else if (strcmp(argv[1], "all")) { int i = atol(argv[1]); cmd[0] = &switch_cmds[i]; diseqc_send_msg(fd, @@ -136,5 +141,3 @@ int main(int argc, char **argv) return 0; } - - |