diff options
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; } - - |