Deleted Added
full compact
usbhid.3 (152763) usbhid.3 (187994)
1.\" $NetBSD: usb.3,v 1.13 2000/09/24 02:17:52 augustss Exp $
2.\"
3.\" Copyright (c) 1999, 2001 Lennart Augustsson <augustss@NetBSD.org>
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:

--- 10 unchanged lines hidden (view full) ---

19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
1.\" $NetBSD: usb.3,v 1.13 2000/09/24 02:17:52 augustss Exp $
2.\"
3.\" Copyright (c) 1999, 2001 Lennart Augustsson <augustss@NetBSD.org>
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:

--- 10 unchanged lines hidden (view full) ---

19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.\" $FreeBSD: head/lib/libusbhid/usbhid.3 152763 2005-11-24 11:26:36Z ru $
27.\" $FreeBSD: head/lib/libusbhid/usbhid.3 187994 2009-02-02 00:49:39Z alfred $
28.\"
28.\"
29.Dd December 29, 2001
29.Dd January 27, 2009
30.Dt USBHID 3
31.Os
32.Sh NAME
33.Nm usbhid ,
34.Nm hid_get_report_desc ,
30.Dt USBHID 3
31.Os
32.Sh NAME
33.Nm usbhid ,
34.Nm hid_get_report_desc ,
35.Nm hid_get_report_id ,
35.Nm hid_use_report_desc ,
36.Nm hid_dispose_report_desc ,
37.Nm hid_start_parse ,
38.Nm hid_end_parse ,
39.Nm hid_get_item ,
40.Nm hid_report_size ,
41.Nm hid_locate ,
42.Nm hid_usage_page ,
43.Nm hid_usage_in_page ,
44.Nm hid_init ,
45.Nm hid_get_data ,
46.Nm hid_set_data
47.Nd USB HID access routines
48.Sh LIBRARY
49.Lb libusbhid
50.Sh SYNOPSIS
51.In usbhid.h
52.Ft report_desc_t
53.Fn hid_get_report_desc "int file"
36.Nm hid_use_report_desc ,
37.Nm hid_dispose_report_desc ,
38.Nm hid_start_parse ,
39.Nm hid_end_parse ,
40.Nm hid_get_item ,
41.Nm hid_report_size ,
42.Nm hid_locate ,
43.Nm hid_usage_page ,
44.Nm hid_usage_in_page ,
45.Nm hid_init ,
46.Nm hid_get_data ,
47.Nm hid_set_data
48.Nd USB HID access routines
49.Sh LIBRARY
50.Lb libusbhid
51.Sh SYNOPSIS
52.In usbhid.h
53.Ft report_desc_t
54.Fn hid_get_report_desc "int file"
55.Ft int
56.Fn hid_get_report_id "int file"
57.Ft int
58.Fn hid_set_immed "int fd" "int enable"
54.Ft report_desc_t
55.Fn hid_use_report_desc "unsigned char *data" "unsigned int size"
56.Ft void
57.Fn hid_dispose_report_desc "report_desc_t d"
58.Ft hid_data_t
59.Fn hid_start_parse "report_desc_t d" "int kindset" "int id"
60.Ft void
61.Fn hid_end_parse "hid_data_t s"

--- 27 unchanged lines hidden (view full) ---

89.Nm
90library contains routines to extract the
91.Em "report descriptor"
92which contains the data layout information and then use this information.
93.Pp
94The routines can be divided into four parts: extraction of the descriptor,
95parsing of the descriptor, translating to/from symbolic names, and
96data manipulation.
59.Ft report_desc_t
60.Fn hid_use_report_desc "unsigned char *data" "unsigned int size"
61.Ft void
62.Fn hid_dispose_report_desc "report_desc_t d"
63.Ft hid_data_t
64.Fn hid_start_parse "report_desc_t d" "int kindset" "int id"
65.Ft void
66.Fn hid_end_parse "hid_data_t s"

--- 27 unchanged lines hidden (view full) ---

94.Nm
95library contains routines to extract the
96.Em "report descriptor"
97which contains the data layout information and then use this information.
98.Pp
99The routines can be divided into four parts: extraction of the descriptor,
100parsing of the descriptor, translating to/from symbolic names, and
101data manipulation.
102.Ss Synchronous HID operation
103Synchronous HID operation can be enabled or disabled by a call to
104.Fn hid_set_immed .
105If the second argument is zero synchronous HID operation is disabled.
106Else synchronous HID operation is enabled.
107The function returns a negative value on failure.
97.Ss Descriptor Functions
108.Ss Descriptor Functions
109The report descriptor ID can be obtained by calling
110.Fn hid_get_report_id .
98A report descriptor can be obtained by calling
99.Fn hid_get_report_desc
100with a file descriptor obtained by opening a
101.Xr uhid 4
102device.
103Alternatively a data buffer containing the report descriptor can be
104passed into
105.Fn hid_use_report_desc .

--- 117 unchanged lines hidden ---
111A report descriptor can be obtained by calling
112.Fn hid_get_report_desc
113with a file descriptor obtained by opening a
114.Xr uhid 4
115device.
116Alternatively a data buffer containing the report descriptor can be
117passed into
118.Fn hid_use_report_desc .

--- 117 unchanged lines hidden ---