From 0741cc91d55c3c8542f7b9e07e6ed177204f14a5 Mon Sep 17 00:00:00 2001 From: mav Date: Thu, 24 May 2012 04:24:17 +0000 Subject: [PATCH] MFC r235519: Add support for -z option for reading operations. It allows to not request current values from device, but only receive changes. Sponsored by: iXsystems, Inc. git-svn-id: svn://svn.freebsd.org/base/stable/8@235881 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- usr.bin/usbhidctl/usbhid.c | 6 +++--- usr.bin/usbhidctl/usbhidctl.1 | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/usr.bin/usbhidctl/usbhid.c b/usr.bin/usbhidctl/usbhid.c index 3f51d80fa..532f7868a 100644 --- a/usr.bin/usbhidctl/usbhid.c +++ b/usr.bin/usbhidctl/usbhid.c @@ -189,11 +189,11 @@ usage(void) fprintf(stderr, "usage: %s -f device " - "[-l] [-n] [-r] [-t tablefile] [-v] [-x] name ...\n", + "[-l] [-n] [-r] [-t tablefile] [-v] [-x] [-z] name ...\n", getprogname()); fprintf(stderr, " %s -f device " - "[-l] [-n] [-r] [-t tablefile] [-v] [-x] -a\n", + "[-l] [-n] [-r] [-t tablefile] [-v] [-x] [-z] -a\n", getprogname()); fprintf(stderr, " %s -f device " @@ -311,7 +311,7 @@ dumpdata(int f, report_desc_t rd, int loop) u_char *dbuf; enum hid_kind kind; - kind = 0; + kind = zflag ? 3 : 0; rid = -1; use_rid = !!hid_get_report_id(f); do { diff --git a/usr.bin/usbhidctl/usbhidctl.1 b/usr.bin/usbhidctl/usbhidctl.1 index 6abeccd79..2fcf426f0 100644 --- a/usr.bin/usbhidctl/usbhidctl.1 +++ b/usr.bin/usbhidctl/usbhidctl.1 @@ -54,6 +54,7 @@ .Op Fl l .Op Fl v .Op Fl x +.Op Fl z .Fl a .Nm .Fl f Ar device @@ -62,6 +63,7 @@ .Op Fl n .Op Fl v .Op Fl x +.Op Fl z .Ar item ... .Nm .Fl f Ar device @@ -106,9 +108,8 @@ Only 'output' and 'feature' kinds can be set with this option. .It Fl x Dump data in hexadecimal as well as decimal. .It Fl z -Reset reports to zero before processing -.Fl w -arguments. If not specified, current values will be requested from device. +Reset reports to zero before processing other arguments. +If not specified, current values will be requested from device. .El .Sh SYNTAX .Nm -- 2.45.0