summaryrefslogtreecommitdiffstats
path: root/lib/libusbhid/usbhid.3
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2011-09-28 14:52:25 +0000
committermav <mav@FreeBSD.org>2011-09-28 14:52:25 +0000
commit3a1a19715027c5c03af47ff8d3ce06461e3b4d65 (patch)
treeed5b81a92c39c4c34a4ab0631b21d7f1764a740f /lib/libusbhid/usbhid.3
parent3383aff65a84084093f4575d6098fac891dcbab9 (diff)
downloadFreeBSD-src-3a1a19715027c5c03af47ff8d3ce06461e3b4d65.zip
FreeBSD-src-3a1a19715027c5c03af47ff8d3ce06461e3b4d65.tar.gz
MFprojects/hid:
Import the rest of HID improvements from the branch: - improve report descriptor parser in libusbhid to handle several kinds of reports same time; - add to the libusbhid API two functions wrapping respective kernel IOCTLs for reading and writing reports; - tune uhid IOCTL interface to allow reading and writing arbitrary report, when multiple supported by the device; - teach usbhidctl to set output and feature reports; - make usbhidaction support all the same item names as bhidctl. Sponsored by: iXsystems, inc.
Diffstat (limited to 'lib/libusbhid/usbhid.3')
-rw-r--r--lib/libusbhid/usbhid.316
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/libusbhid/usbhid.3 b/lib/libusbhid/usbhid.3
index b4951f2..c34a109 100644
--- a/lib/libusbhid/usbhid.3
+++ b/lib/libusbhid/usbhid.3
@@ -44,7 +44,9 @@
.Nm hid_usage_in_page ,
.Nm hid_init ,
.Nm hid_get_data ,
-.Nm hid_set_data
+.Nm hid_set_data ,
+.Nm hid_get_report ,
+.Nm hid_set_report
.Nd USB HID access routines
.Sh LIBRARY
.Lb libusbhid
@@ -84,6 +86,10 @@
.Fn hid_get_data "const void *data" "const hid_item_t *h"
.Ft void
.Fn hid_set_data "void *buf" "const hid_item_t *h" "int data"
+.Ft int
+.Fn hid_get_report "int fd" "enum hid_kind k" "unsigned char *data" "unsigned int size"
+.Ft int
+.Fn hid_set_report "int fd" "enum hid_kind k" "unsigned char *data" "unsigned int size"
.Sh DESCRIPTION
The
.Nm
@@ -105,6 +111,14 @@ Synchronous HID operation can be enabled or disabled by a call to
If the second argument is zero synchronous HID operation is disabled.
Else synchronous HID operation is enabled.
The function returns a negative value on failure.
+.Pp
+.Fn hid_get_report
+and
+.Fn hid_set_report
+functions allow to synchronously get and set specific report if device
+supports it.
+For devices with multiple report IDs, wanted ID should be provided in the
+first byte of the buffer for both get and set.
.Ss Descriptor Functions
The report descriptor ID can be obtained by calling
.Fn hid_get_report_id .
OpenPOWER on IntegriCloud