aboutsummaryrefslogtreecommitdiffstats
path: root/test/diseqc.c
diff options
context:
space:
mode:
authorMark Purcell <msp@debian.org>2008-06-22 11:00:40 +1000
committeretobi <git@e-tobi.net>2013-09-03 09:48:42 +0200
commit891c51ff368ed700dec6025eeb47ce4d96f76418 (patch)
tree3729664829e4faa691d403274f38eb10890b533c /test/diseqc.c
parent1c6e1f28f54ec2606c23936c1d8689f2be55a86c (diff)
parentab959d7b4194715870128e616b8e29d4a101e488 (diff)
downloadlinux-dvb-apps-891c51ff368ed700dec6025eeb47ce4d96f76418.tar.gz
Imported Debian patch 1.1.1+rev1207-1debian/1.1.1+rev1207-1
Diffstat (limited to 'test/diseqc.c')
-rw-r--r--test/diseqc.c19
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;
}
-
-