aboutsummaryrefslogtreecommitdiff
path: root/lib/libusbhid/usbhid.3
diff options
context:
space:
mode:
authorMatthew N. Dodd <mdodd@FreeBSD.org>2003-04-09 01:52:49 +0000
committerMatthew N. Dodd <mdodd@FreeBSD.org>2003-04-09 01:52:49 +0000
commitcf0e07e504093d39ee5a0782b88ad372a9893643 (patch)
tree4973be599e3f1175e30998a134f2b847577c193f /lib/libusbhid/usbhid.3
parent06283c3ba9bde2a30fdcdf7ff57355ae50d6913b (diff)
downloadsrc-cf0e07e504093d39ee5a0782b88ad372a9893643.tar.gz
src-cf0e07e504093d39ee5a0782b88ad372a9893643.zip
Notes
Diffstat (limited to 'lib/libusbhid/usbhid.3')
-rw-r--r--lib/libusbhid/usbhid.354
1 files changed, 28 insertions, 26 deletions
diff --git a/lib/libusbhid/usbhid.3 b/lib/libusbhid/usbhid.3
index c0beea7f4314..6db749551b22 100644
--- a/lib/libusbhid/usbhid.3
+++ b/lib/libusbhid/usbhid.3
@@ -1,6 +1,6 @@
.\" $NetBSD: usb.3,v 1.13 2000/09/24 02:17:52 augustss Exp $
.\"
-.\" Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
+.\" Copyright (c) 1999, 2001 Lennart Augustsson <augustss@NetBSD.org>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 11, 1999
+.Dd December 29, 2001
.Dt USBHID 3
.Os
.Sh NAME
@@ -48,7 +48,7 @@
.Sh LIBRARY
.Lb libusbhid
.Sh SYNOPSIS
-.In libusbhid.h
+.In usbhid.h
.Ft report_desc_t
.Fn hid_get_report_desc "int file"
.Ft report_desc_t
@@ -56,34 +56,34 @@
.Ft void
.Fn hid_dispose_report_desc "report_desc_t d"
.Ft hid_data_t
-.Fn hid_start_parse "report_desc_t d" "int kindset"
+.Fn hid_start_parse "report_desc_t d" "int kindset" "int id"
.Ft void
.Fn hid_end_parse "hid_data_t s"
.Ft int
.Fn hid_get_item "hid_data_t s" "hid_item_t *h"
.Ft int
-.Fn hid_report_size "report_desc_t d" "unsigned int id" "hid_kind_t k"
+.Fn hid_report_size "report_desc_t d" "hid_kind_t k" "int id"
.Ft int
-.Fn hid_locate "report_desc_t d" "unsigned int usage" "hid_kind_t k" "hid_item_t *h"
-.Ft "const char *"
+.Fn hid_locate "report_desc_t d" "u_int usage" "hid_kind_t k" "hid_item_t *h" "int id"
+.Ft char *
.Fn hid_usage_page "int i"
-.Ft "const char *"
-.Fn hid_usage_in_page "unsigned int u"
+.Ft char *
+.Fn hid_usage_in_page "u_int u"
.Ft int
-.Fn hid_parse_usage_page "const char *name"
-.Ft int
-.Fn hid_parse_usage_in_page "const char *name"
+.Fn hid_parse_usage_page "const char *"
+.Ft char *
+.Fn hid_parse_usage_in_page "const char *"
.Ft void
-.Fn hid_init "const char *file"
+.Fn hid_init "char *file"
.Ft int
-.Fn hid_get_data "const void *data" "const hid_item_t *h"
+.Fn hid_get_data "void *data" "hid_item_t *h"
.Ft void
-.Fn hid_set_data "void *p" "const hid_item_t *h" "int data"
+.Fn hid_set_data "void *data" "hid_item_t *h" "u_int data"
.Sh DESCRIPTION
The
.Nm
library provides routines to extract data from USB Human Interface Devices.
-.Ss Introduction
+.Ss INTRODUCTION
USB HID devices send and receive data layed out in a device dependent way.
The
.Nm
@@ -94,7 +94,7 @@ which contains the data layout information and then use this information.
The routines can be divided into four parts: extraction of the descriptor,
parsing of the descriptor, translating to/from symbolic names, and
data manipulation.
-.Ss Descriptor Functions
+.Ss DESCRIPTOR FUNCTIONS
A report descriptor can be obtained by calling
.Fn hid_get_report_desc
with a file descriptor obtained by opening a
@@ -114,18 +114,19 @@ If
.Fn hid_dispose_report_desc
fails it will return
.Dv NULL .
-.Ss Descriptor Parsing Functions
+.Ss DESCRIPTOR PARSING FUNCTIONS
To parse the report descriptor the
.Fn hid_start_parse
function should be called with a report descriptor and a set that
describes which items that are interesting.
-The set is obtained
-by OR-ing together values
+The set is obtained by OR-ing together values
.Fa "(1 << k)"
where
.Fa k
is an item of type
.Vt hid_kind_t .
+The report id (if present) is given by
+.Fa id .
The function returns
.Dv NULL
if the initialization fails, otherwise an opaque value to be used
@@ -146,15 +147,16 @@ will be filled with the relevant data for the item.
The definition of
.Vt hid_item_t
can be found in
-.Aq Pa libusbhid.h
+.Aq Pa usbhid.h
and the meaning of the components in the USB HID documentation.
.Pp
Data should be read/written to the device in the size of
the report.
-The size of a report (of a certain kind) can be
-computed by the
+The size of a report (of a certain kind) can be computed by the
.Fn hid_report_size
function.
+If the report is prefixed by an ID byte it is given by
+.Fa id .
.Pp
To locate a single item the
.Fn hid_locate
@@ -162,7 +164,7 @@ function can be used.
It should be given the usage code of
the item and its kind and it will fill the item and return
non-zero if the item was found.
-.Ss Name Translation Functions
+.Ss Name TRANSLATION FUNCTIONS
The function
.Fn hid_usage_page
will return the symbolic name of a usage page, and the function
@@ -188,7 +190,7 @@ with the name of the table.
Passing
.Dv NULL
to this function will cause it to use the default table.
-.Ss Data Extraction Functions
+.Ss Data EXTRACTION FUNCTIONS
Given the data obtained from a HID device and an item in the
report descriptor the
.Fn hid_get_data
@@ -209,7 +211,7 @@ This man page is woefully incomplete.
The
.Tn USB
specifications can be found at
-.Pa http://www.usb.org/developers/docs.htm .
+.Pa http://www.usb.org/developers/docs.html .
.Pp
.Xr uhid 4 ,
.Xr usb 4