Machine Interface Utility:VER1.0
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
sgml_files = manual.sgml intro.sgml api.sgml functions.sgml examples.sgml
|
||||
|
||||
# For when we have a man page :)
|
||||
man_MANS =
|
||||
|
||||
EXTRA_DIST = manual.sgml api.sgml examples.sgml functions.sgml \
|
||||
intro.sgml website.dsl $(man_MANS)
|
||||
|
||||
# I grabbed this same hack from the VACM docs/Makfile.am
|
||||
CLEANFILES = manual.dvi manual.aux manual.tex manual.log \
|
||||
manual.ps.gz; rm -rf html
|
||||
|
||||
if BUILD_DOCS
|
||||
#MANUALS = manual.ps.gz html/index.html
|
||||
MANUALS = html/index.html
|
||||
# Generating postscript takes forever on my laptop apparentely
|
||||
else
|
||||
MANUALS =
|
||||
endif
|
||||
|
||||
all: $(MANUALS)
|
||||
|
||||
manual.ps.gz: $(sgml_files) website.dsl
|
||||
@JADE@ -t ps -d $(srcdir)/website.dsl\#print $(srcdir)/manual.sgml
|
||||
gzip manual.ps
|
||||
|
||||
html/index.html: $(sgml_files) website.dsl
|
||||
rm -rf html
|
||||
mkdir html
|
||||
@JADE@ -t sgml -d $(srcdir)/website.dsl\#html $(srcdir)/manual.sgml
|
||||
|
||||
@@ -0,0 +1,236 @@
|
||||
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
BIGENDIAN = @BIGENDIAN@
|
||||
CC = @CC@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
ECHO = @ECHO@
|
||||
EXEEXT = @EXEEXT@
|
||||
JADE = @JADE@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBUSB_BINARY_AGE = @LIBUSB_BINARY_AGE@
|
||||
LIBUSB_INTERFACE_AGE = @LIBUSB_INTERFACE_AGE@
|
||||
LIBUSB_MAJOR_VERSION = @LIBUSB_MAJOR_VERSION@
|
||||
LIBUSB_MICRO_VERSION = @LIBUSB_MICRO_VERSION@
|
||||
LIBUSB_MINOR_VERSION = @LIBUSB_MINOR_VERSION@
|
||||
LIBUSB_VERSION = @LIBUSB_VERSION@
|
||||
LN_S = @LN_S@
|
||||
LT_AGE = @LT_AGE@
|
||||
LT_CURRENT = @LT_CURRENT@
|
||||
LT_RELEASE = @LT_RELEASE@
|
||||
LT_REVISION = @LT_REVISION@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
|
||||
sgml_files = manual.sgml intro.sgml api.sgml functions.sgml examples.sgml
|
||||
# For when we have a man page :)
|
||||
man_MANS =
|
||||
EXTRA_DIST = manual.sgml api.sgml examples.sgml functions.sgml \
|
||||
# I grabbed this same hack from the VACM docs/Makfile.am
|
||||
CLEANFILES = manual.dvi manual.aux manual.tex manual.log \
|
||||
MANUALS =
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
MANS = $(man_MANS)
|
||||
|
||||
NROFF = nroff
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
install-man: $(MANS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(MAKE) $(AM_MAKEFLAGS)
|
||||
uninstall-man:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
$(MAKE) $(AM_MAKEFLAGS)
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = doc
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
here=`cd $(top_builddir) && pwd`; \
|
||||
top_distdir=`cd $(top_distdir) && pwd`; \
|
||||
distdir=`cd $(distdir) && pwd`; \
|
||||
cd $(top_srcdir) \
|
||||
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu doc/Makefile
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
info-am:
|
||||
info: info-am
|
||||
dvi-am:
|
||||
dvi: dvi-am
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
install-exec-am:
|
||||
install-exec: install-exec-am
|
||||
|
||||
install-data-am: install-man
|
||||
install-data: install-data-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am: uninstall-man
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile $(MANS)
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-am
|
||||
|
||||
distclean-am: distclean-generic clean-am
|
||||
-rm -f libtool
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
maintainer-clean-am: maintainer-clean-generic distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
.PHONY: install-man uninstall-man tags distdir info-am info dvi-am dvi \
|
||||
check check-am installcheck-am installcheck install-exec-am \
|
||||
install-exec install-data-am install-data install-am install \
|
||||
uninstall-am uninstall all-redirect all-am all installdirs \
|
||||
mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
|
||||
intro.sgml website.dsl $(man_MANS)
|
||||
|
||||
manual.ps.gz; rm -rf html
|
||||
|
||||
if BUILD_DOCS
|
||||
# Generating postscript takes forever on my laptop apparentely
|
||||
else
|
||||
endif
|
||||
|
||||
all: $(MANUALS)
|
||||
|
||||
manual.ps.gz: $(sgml_files) website.dsl
|
||||
@JADE@ -t ps -d $(srcdir)/website.dsl\#print $(srcdir)/manual.sgml
|
||||
gzip manual.ps
|
||||
|
||||
html/index.html: $(sgml_files) website.dsl
|
||||
rm -rf html
|
||||
mkdir html
|
||||
@JADE@ -t sgml -d $(srcdir)/website.dsl\#html $(srcdir)/manual.sgml
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -0,0 +1,38 @@
|
||||
<!-- FIXME: I want this to be displayed as one page, not seperate -->
|
||||
|
||||
<title>API</title>
|
||||
<partintro>
|
||||
<para>This is the external API for applications to use.</para>
|
||||
<para>The API is relatively lean and designed to have close analogies to the USB specification. The v0.1 API was mostly hacked together and kludged together without much forethought and as a result, it's missing quite a few features. v1.0 is intended to rectify this.</para>
|
||||
</partintro>
|
||||
|
||||
<chapter id="api-device-interfaces">
|
||||
<title>Devices and interfaces</title>
|
||||
|
||||
<para>The libusb API ties an open device to a specific interface. This means that if you want to claim multiple interfaces on a device, you should open the device multiple times to receive one usb_dev_handle for each interface you want to communicate with. Don't forget to call <xref linkend="function.usbclaiminterface">.</para>
|
||||
</chapter>
|
||||
|
||||
<chapter id="api-timeouts">
|
||||
<title>Timeouts</title>
|
||||
|
||||
<para>Timeout's in libusb are always specified in milliseconds.</para>
|
||||
</chapter>
|
||||
|
||||
<chapter id="api-types">
|
||||
<title>Data Types</title>
|
||||
|
||||
<para>libusb uses both abstracted and non abstracted structures to maintain portability.</para>
|
||||
</chapter>
|
||||
|
||||
<chapter id="api-synchronous">
|
||||
<title>Synchronous</title>
|
||||
|
||||
<para>All functions in libusb v0.1 are synchronous, meaning the functions block and wait for the operation to finish or timeout before returning execution to the calling application. Asynchronous operation will be supported in v1.0, but not v0.1.</para>
|
||||
</chapter>
|
||||
|
||||
<chapter id="api-return-values">
|
||||
<title>Return values</title>
|
||||
|
||||
<para>There are two types of return values used in libusb v0.1. The first is a handle returned by <xref linkend="function.usbopen">. The second is an int. In all cases where an int is returned, >= 0 is a success and < 0 is an error condition.</para>
|
||||
</chapter>
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
<title>Examples</title>
|
||||
<partintro>
|
||||
<para>There are some nonintuitive parts of libusb v0.1 that aren't difficult, but are probably easier to understand with some examples.</para>
|
||||
</partintro>
|
||||
|
||||
<chapter id="examples-code">
|
||||
<title>Basic Examples</title>
|
||||
<para>Before any communication can occur with a device, it needs to be found. This is accomplished by finding all of the busses and then finding all of the devices on all of the busses:</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
struct usb_bus *busses;
|
||||
|
||||
usb_init();
|
||||
usb_find_busses();
|
||||
usb_find_devices();
|
||||
|
||||
busses = usb_get_busses();
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>After this, the application should manually loop through all of the busess and all of the devices and matching the device by whatever criteria is needed:</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
struct usb_bus *bus;
|
||||
int c, i, a;
|
||||
|
||||
/* ... */
|
||||
|
||||
for (bus = busses; bus; bus = bus->next) {
|
||||
struct usb_device *dev;
|
||||
|
||||
for (dev = bus->devices; dev; dev = dev->next) {
|
||||
/* Check if this device is a printer */
|
||||
if (dev->descriptor.bDeviceClass == 7) {
|
||||
/* Open the device, claim the interface and do your processing */
|
||||
...
|
||||
}
|
||||
|
||||
/* Loop through all of the configurations */
|
||||
for (c = 0; c < dev->descriptor.bNumConfigurations; c++) {
|
||||
/* Loop through all of the interfaces */
|
||||
for (i = 0; i < dev->config[c].bNumInterfaces; i++) {
|
||||
/* Loop through all of the alternate settings */
|
||||
for (a = 0; a < dev->config[c].interface[i].num_altsetting; a++) {
|
||||
/* Check if this interface is a printer */
|
||||
if (dev->config[c].interface[i].altsetting[a].bInterfaceClass == 7) {
|
||||
/* Open the device, set the alternate setting, claim the interface and do your processing */
|
||||
...
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</programlisting>
|
||||
</chapter>
|
||||
|
||||
<chapter id="examples-tests">
|
||||
<title>Examples in the source distribution</title>
|
||||
<para>The tests directory has a program called testlibusb.c. It simply calls libusb to find all of the devices, then iterates through all of the devices and prints out the descriptor dump. It's very simple and as a result, it's of limited usefulness in itself. However, it could serve as a starting point for a new program.</para>
|
||||
</chapter>
|
||||
|
||||
<chapter id="examples-other">
|
||||
<title>Other Applications</title>
|
||||
<para>Another source of examples can be obtained from other applications.</para>
|
||||
<itemizedlist>
|
||||
<listitem><para><ulink url="http://www.gphoto.org/">gPhoto</ulink> uses libusb to communicate with digital still cameras.</para></listitem>
|
||||
<listitem><para><ulink url="http://rio500.sourceforge.net/">rio500</ulink> utils uses libusb to communicate with SONICblue Rio 500 Digital Audio Player.</para></listitem>
|
||||
</itemizedlist>
|
||||
</chapter>
|
||||
|
||||
@@ -0,0 +1,540 @@
|
||||
<title>Functions</title>
|
||||
|
||||
<reference id="ref.core">
|
||||
<title>Core</title>
|
||||
<partintro>
|
||||
<!-- FIXME: Check spelling of "comprise" -->
|
||||
<para>These functions comprise the core of libusb. They are used by all applications that utilize libusb.</para>
|
||||
</partintro>
|
||||
|
||||
<refentry id="function.usbinit">
|
||||
<refnamediv>
|
||||
<refname>usb_init</refname>
|
||||
<refpurpose>Initialize libusb</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>void <function>usb_init</function></funcdef>
|
||||
<void>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>Just like the name implies, <function>usb_init</function> sets up some internal structures. <function>usb_init</function> <emphasis>must</emphasis> be called before any other libusb functions.</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.usbfindbusses">
|
||||
<refnamediv>
|
||||
<refname>usb_find_busses</refname>
|
||||
<refpurpose>Finds all USB busses on system</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>usb_find_busses</function></funcdef>
|
||||
<void>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para><function>usb_find_busses</function> will find all of the busses on the system. Returns the number of changes since previous call to this function (total of new busses and busses removed).</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.usbfinddevices">
|
||||
<refnamediv>
|
||||
<refname>usb_find_devices</refname>
|
||||
<refpurpose>Find all devices on all USB devices</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>usb_find_devices</function></funcdef>
|
||||
<void>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para><function>usb_find_devices</function> will find all of the devices on each bus. This should be called after <xref linkend="function.usbfindbusses">. Returns the number of changes since the previous call to this function (total of new device and devices removed).</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.usbgetbusses">
|
||||
<refnamediv>
|
||||
<refname>usb_get_busses</refname>
|
||||
<refpurpose>Return the list of USB busses found</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>struct usb_bus *<function>usb_get_busses</function></funcdef>
|
||||
<void>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para><function>usb_get_busses</function> simply returns the value of the global variable <varname>usb_busses</varname>. This was implemented for those languages that support C calling convention and can use shared libraries, but don't support C global variables (like Delphi).</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</reference>
|
||||
|
||||
<reference id="ref.deviceops">
|
||||
<title>Device operations</title>
|
||||
<partintro>
|
||||
<para>This group of functions deal with the device. It allows you to open and close the device as well standard USB operations like setting the configuration, alternate settings, clearing halts and resetting the device. It also provides OS level operations such as claiming and releasing interfaces.</para>
|
||||
</partintro>
|
||||
|
||||
<refentry id="function.usbopen">
|
||||
<refnamediv>
|
||||
<refname>usb_open</refname>
|
||||
<refpurpose>Opens a USB device</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>usb_dev_handle *<function>usb_open</function></funcdef>
|
||||
<paramdef>struct *usb_device <parameter>dev</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para><function>usb_open</function> is to be used to open up a device for use. <function>usb_open</function> must be called before attempting to perform any operations to the device. Returns a handle used in future communication with the device.</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.usbclose">
|
||||
<refnamediv>
|
||||
<refname>usb_close</refname>
|
||||
<refpurpose>Closes a USB device</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>usb_close</function></funcdef>
|
||||
<paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para><function>usb_close</function> closes a device opened with <xref linkend="function.usbopen">. No further operations may be performed on the handle after <function>usb_close</function> is called. Returns 0 on success or < 0 on error.</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.usbsetconfiguration">
|
||||
<refnamediv>
|
||||
<refname>usb_set_configuration</refname>
|
||||
<refpurpose>Sets the active configuration of a device</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>usb_set_configuration</function></funcdef>
|
||||
<paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
|
||||
<paramdef>int <parameter>configuration</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para><function>usb_set_configuration</function> sets the active configuration of a device. The <varname>configuration</varname> parameter is the value as specified in the descriptor field bConfigurationValue. Returns 0 on success or < 0 on error.</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.usbsetaltinterface">
|
||||
<refnamediv>
|
||||
<refname>usb_set_altinterface</refname>
|
||||
<refpurpose>Sets the active alternate setting of the current interface</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>usb_set_altinterface</function></funcdef>
|
||||
<paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
|
||||
<paramdef>int <parameter>alternate</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para><function>usb_set_altinterface</function> sets the active alternate setting of the current interface. The <varname>alternate</varname> parameter is the value as specified in the descriptor field bAlternateSetting. Returns 0 on success or < 0 on error.</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.usbresetep">
|
||||
<refnamediv>
|
||||
<refname>usb_resetep</refname>
|
||||
<refpurpose>Resets state for an endpoint</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>usb_resetep</function></funcdef>
|
||||
<paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
|
||||
<paramdef>unsigned int <parameter>ep</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para><function>usb_resetep</function> resets all state (like toggles) for the specified endpoint. The <varname>ep</varname> parameter is the value specified in the descriptor field bEndpointAddress. Returns 0 on success or < 0 on error.</para>
|
||||
<note>
|
||||
<title>Deprecated</title>
|
||||
<para><function>usb_resetep</function> is deprecated. You probably want to use <xref linkend="function.usbclearhalt">.</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.usbclearhalt">
|
||||
<refnamediv>
|
||||
<refname>usb_clear_halt</refname>
|
||||
<refpurpose>Clears any halt status on an endpoint</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>usb_clear_halt</function></funcdef>
|
||||
<paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
|
||||
<paramdef>unsigned int <parameter>ep</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para><function>usb_clear_halt</function> clears any halt status on the specified endpoint. The <varname>ep</varname> parameter is the value specified in the descriptor field bEndpointAddress. Returns 0 on success or < 0 on error.</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.usbreset">
|
||||
<refnamediv>
|
||||
<refname>usb_reset</refname>
|
||||
<refpurpose>Resets a device</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>usb_reset</function></funcdef>
|
||||
<paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para><function>usb_reset</function> resets the specified device by sending a RESET down the port it is connected to. Returns 0 on success or < 0 on error.</para>
|
||||
<note>
|
||||
<title>Causes re-enumeration</title>
|
||||
<para>After calling <function>usb_reset</function>, the device will need to re-enumerate and thusly, requires you to find the new device and open a new handle. The handle used to call <function>usb_reset</function> will no longer work.</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.usbclaiminterface">
|
||||
<refnamediv>
|
||||
<refname>usb_claim_interface</refname>
|
||||
<refpurpose>Claim an interface of a device</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>usb_claim_interface</function></funcdef>
|
||||
<paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
|
||||
<paramdef>int <parameter>interface</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para><function>usb_claim_interface</function> claims the interface with the Operating System. The interface parameter is the value as specified in the descriptor field bInterfaceNumber. Returns 0 on success or < 0 on error.</para>
|
||||
<important>
|
||||
<title>Must be called!</title>
|
||||
<para><function>usb_claim_interface</function> <emphasis>must</emphasis> be called before you perform any operations related to this interface (like <xref linkend="function.usbsetaltinterface">, <xref linkend="function.usbbulkwrite">, etc).</para>
|
||||
</important>
|
||||
|
||||
<table>
|
||||
<title>Return Codes</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>code</entry>
|
||||
<entry>description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>-EBUSY</entry>
|
||||
<entry>Interface is not available to be claimed</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>-ENOMEM</entry>
|
||||
<entry>Insufficient memory</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.usbreleaseinterface">
|
||||
<refnamediv>
|
||||
<refname>usb_release_interface</refname>
|
||||
<refpurpose>Releases a previously claimed interface</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>usb_release_interface</function></funcdef>
|
||||
<paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
|
||||
<paramdef>int <parameter>interface</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para><function>usb_release_interface</function> releases an interface previously claimed with <xref linkend="function.usbclaiminterface">. The interface parameter is the value as specified in the descriptor field bInterfaceNumber. Returns 0 on success or < 0 on error.</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</reference>
|
||||
|
||||
<reference id="ref.control">
|
||||
<title>Control Transfers</title>
|
||||
<partintro>
|
||||
<para>This group of functions allow applications to send messages to the default control pipe.</para>
|
||||
</partintro>
|
||||
|
||||
<refentry id="function.usbcontrolmsg">
|
||||
<refnamediv>
|
||||
<refname>usb_control_msg</refname>
|
||||
<refpurpose>Send a control message to a device</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>usb_control_msg</function></funcdef>
|
||||
<paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
|
||||
<paramdef>int <parameter>requesttype</parameter></paramdef>
|
||||
<paramdef>int <parameter>request</parameter></paramdef>
|
||||
<paramdef>int <parameter>value</parameter></paramdef>
|
||||
<paramdef>int <parameter>index</parameter></paramdef>
|
||||
<paramdef>char *<parameter>bytes</parameter></paramdef>
|
||||
<paramdef>int <parameter>size</parameter></paramdef>
|
||||
<paramdef>int <parameter>timeout</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para><function>usb_control_msg</function> performs a control request to the default control pipe on a device. The parameters mirror the types of the same name in the USB specification. Returns number of bytes written/read or < 0 on error.</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.usbgetstring">
|
||||
<refnamediv>
|
||||
<refname>usb_get_string</refname>
|
||||
<refpurpose>Retrieves a string descriptor from a device</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>usb_get_string</function></funcdef>
|
||||
<paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
|
||||
<paramdef>int <parameter>index</parameter></paramdef>
|
||||
<paramdef>int <parameter>langid</parameter></paramdef>
|
||||
<paramdef>char *<parameter>buf</parameter></paramdef>
|
||||
<paramdef>size_t <parameter>buflen</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para><function>usb_get_string</function> retrieves the string descriptor specified by index and langid from a device. The string will be returned in Unicode as specified by the USB specification. Returns the number of bytes returned in <varname>buf</varname> or < 0 on error.</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.usbgetstringsimple">
|
||||
<refnamediv>
|
||||
<refname>usb_get_string_simple</refname>
|
||||
<refpurpose>Retrieves a string descriptor from a device using the first language</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>usb_get_string_simple</function></funcdef>
|
||||
<paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
|
||||
<paramdef>int <parameter>index</parameter></paramdef>
|
||||
<paramdef>char *<parameter>buf</parameter></paramdef>
|
||||
<paramdef>size_t <parameter>buflen</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para><function>usb_get_string_simple</function> is a wrapper around <function>usb_get_string</function> that retrieves the string description specified by index in the first language for the descriptor and converts it into C style ASCII. Returns number of bytes returned in <varname>buf</varname> or < 0 on error.</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.usbgetdescriptor">
|
||||
<refnamediv>
|
||||
<refname>usb_get_descriptor</refname>
|
||||
<refpurpose>Retrieves a descriptor from a device's default control pipe</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>usb_get_descriptor</function></funcdef>
|
||||
<paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
|
||||
<paramdef>unsigned char <parameter>type</parameter></paramdef>
|
||||
<paramdef>unsigned char <parameter>index</parameter></paramdef>
|
||||
<paramdef>void *<parameter>buf</parameter></paramdef>
|
||||
<paramdef>int <parameter>size</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para><function>usb_get_descriptor</function> retrieves a descriptor from the device identified by the <varname>type</varname> and <varname>index</varname> of the descriptor from the default control pipe. Returns number of bytes read for the descriptor or < 0 on error.</para>
|
||||
<para>See <xref linkend="function.usbgetdescriptorbyendpoint"> for a function that allows the control endpoint to be specified.</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.usbgetdescriptorbyendpoint">
|
||||
<refnamediv>
|
||||
<refname>usb_get_descriptor_by_endpoint</refname>
|
||||
<refpurpose>Retrieves a descriptor from a device</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>usb_get_descriptor_by_endpoint</function></funcdef>
|
||||
<paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
|
||||
<paramdef>int <parameter>ep</parameter></paramdef>
|
||||
<paramdef>unsigned char <parameter>type</parameter></paramdef>
|
||||
<paramdef>unsigned char <parameter>index</parameter></paramdef>
|
||||
<paramdef>void *<parameter>buf</parameter></paramdef>
|
||||
<paramdef>int <parameter>size</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para><function>usb_get_descriptor_by_endpoint</function> retrieves a descriptor from the device identified by the <varname>type</varname> and <varname>index</varname> of the descriptor from the control pipe identified by <varname>ep</varname>. Returns number of bytes read for the descriptor or < 0 on error.</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</reference>
|
||||
|
||||
<reference id="ref.bulk">
|
||||
<title>Bulk Transfers</title>
|
||||
<partintro>
|
||||
<para>This group of functions allow applications to send and receive data via bulk pipes.</para>
|
||||
</partintro>
|
||||
|
||||
<refentry id="function.usbbulkwrite">
|
||||
<refnamediv>
|
||||
<refname>usb_bulk_write</refname>
|
||||
<refpurpose>Write data to a bulk endpoint</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>usb_bulk_write</function></funcdef>
|
||||
<paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
|
||||
<paramdef>int <parameter>ep</parameter></paramdef>
|
||||
<paramdef>char *<parameter>bytes</parameter></paramdef>
|
||||
<paramdef>int <parameter>size</parameter></paramdef>
|
||||
<paramdef>int <parameter>timeout</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para><function>usb_bulk_write</function> performs a bulk write request to the endpoint specified by <varname>ep</varname>. Returns number of bytes written on success or < 0 on error.</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.usbbulkread">
|
||||
<refnamediv>
|
||||
<refname>usb_bulk_read</refname>
|
||||
<refpurpose>Read data from a bulk endpoint</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>usb_bulk_read</function></funcdef>
|
||||
<paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
|
||||
<paramdef>int <parameter>ep</parameter></paramdef>
|
||||
<paramdef>char *<parameter>bytes</parameter></paramdef>
|
||||
<paramdef>int <parameter>size</parameter></paramdef>
|
||||
<paramdef>int <parameter>timeout</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para><function>usb_bulk_read</function> performs a bulk read request to the endpoint specified by <varname>ep</varname>. Returns number of bytes read on success or < 0 on error.</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</reference>
|
||||
|
||||
<reference id="ref.interrupt">
|
||||
<title>Interrupt Transfers</title>
|
||||
<partintro>
|
||||
<para>This group of functions allow applications to send and receive data via interrupt pipes.</para>
|
||||
</partintro>
|
||||
|
||||
<refentry id="function.usbinterruptwrite">
|
||||
<refnamediv>
|
||||
<refname>usb_interrupt_write</refname>
|
||||
<refpurpose>Write data to an interrupt endpoint</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>usb_interrupt_write</function></funcdef>
|
||||
<paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
|
||||
<paramdef>int <parameter>ep</parameter></paramdef>
|
||||
<paramdef>char *<parameter>bytes</parameter></paramdef>
|
||||
<paramdef>int <parameter>size</parameter></paramdef>
|
||||
<paramdef>int <parameter>timeout</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para><function>usb_interrupt_write</function> performs an interrupt write request to the endpoint specified by <varname>ep</varname>. Returns number of bytes written on success or < 0 on error.</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.usbinterruptread">
|
||||
<refnamediv>
|
||||
<refname>usb_interrupt_read</refname>
|
||||
<refpurpose>Read data from a interrupt endpoint</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>usb_interrupt_read</function></funcdef>
|
||||
<paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
|
||||
<paramdef>int <parameter>ep</parameter></paramdef>
|
||||
<paramdef>char *<parameter>bytes</parameter></paramdef>
|
||||
<paramdef>int <parameter>size</parameter></paramdef>
|
||||
<paramdef>int <parameter>timeout</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para><function>usb_interrupt_read</function> performs a interrupt read request to the endpoint specified by <varname>ep</varname>. Returns number of bytes read on success or < 0 on error.</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</reference>
|
||||
|
||||
<reference id="ref.nonportable">
|
||||
<title>Non Portable</title>
|
||||
<partintro>
|
||||
<para>These functions are non portable. They may expose some part of the USB API on one OS or perhaps a couple, but not all. They are all marked with the string _np at the end of the function name.</para>
|
||||
<para>A C preprocessor macro will be defined if the function is implemented. The form is LIBUSB_HAS_ prepended to the function name, without the leading "usb_", in all caps. For example, if usb_get_driver_np is implemented, LIBUSB_HAS_GET_DRIVER_NP will be defined.</para>
|
||||
</partintro>
|
||||
|
||||
<refentry id="function.usbgetdrivernp">
|
||||
<refnamediv>
|
||||
<refname>usb_get_driver_np</refname>
|
||||
<refpurpose>Get driver name bound to interface</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>usb_get_driver_np</function></funcdef>
|
||||
<paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
|
||||
<paramdef>int <parameter>interface</parameter></paramdef>
|
||||
<paramdef>char *<parameter>name</parameter></paramdef>
|
||||
<paramdef>int <parameter>namelen</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>This function will obtain the name of the driver bound to the interface specified by the parameter <parameter>interface</parameter> and place it into the buffer named <parameter>name</parameter> limited to <parameter>namelen</parameter> characters. Returns 0 on success or < 0 on error.</para>
|
||||
<para>Implemented on Linux only.</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.usbdetachkerneldrivernp">
|
||||
<refnamediv>
|
||||
<refname>usb_detach_kernel_driver_np</refname>
|
||||
<refpurpose>Detach kernel driver from interface</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>usb_detach_kernel_driver_np</function></funcdef>
|
||||
<paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
|
||||
<paramdef>int <parameter>interface</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>This function will detach a kernel driver from the interface specified by parameter <parameter>interface</parameter>. Applications using libusb can then try claiming the interface. Returns 0 on success or < 0 on error.</para>
|
||||
<para>Implemented on Linux only.</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</reference>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<title>Introduction</title>
|
||||
<chapter id="intro-overview">
|
||||
<title>Overview</title>
|
||||
<para>This documentation will give an overview of how the v0.1 libusb API works and relates to &usb;. Work is rapidly progressing on a newer version of libusb, to be v1.0, which will be a redesigned API and is intended to obsolete v0.1. You may want to check the <ulink url="http://libusb.sourceforge.net/">libusb</ulink> website to see if it is stable and recommended.</para>
|
||||
<para>This documentation assumes that you have a good understanding of &usb; and how it works. If you don't have a good understanding of USB, it is recommended you obtain the USB <ulink url="http://www.usb.org/developers/docs/usbspec.zip">v1.1</ulink> and/or <ulink url="http://www.usb.org/developers/docs/usb_20.zip">v2.0</ulink> specs and read them.</para>
|
||||
<para>libusb is geared towards &usb; 1.1, however from the perspective of libusb, &usb; 2.0 won't be a significant change for libusb</para>
|
||||
</chapter>
|
||||
|
||||
<chapter id="intro-support">
|
||||
<title>Current OS support</title>
|
||||
<itemizedlist>
|
||||
<listitem><para><ulink url="http://www.kernel.org/">Linux</ulink> (2.2, 2.4 and on)</para></listitem>
|
||||
<listitem><para><ulink url="http://www.freebsd.org/">FreeBSD</ulink>, <ulink url="http://www.netbsd.org/">NetBSD</ulink> and <ulink url="http://www.openbsd.org/">OpenBSD</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://developer.apple.com/darwin/">Darwin</ulink>/<ulink url="http://developer.apple.com/macosx/">MacOS X</ulink></para></listitem>
|
||||
</itemizedlist>
|
||||
</chapter>
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
|
||||
|
||||
<!ENTITY intro SYSTEM "intro.sgml">
|
||||
<!ENTITY api SYSTEM "api.sgml">
|
||||
<!ENTITY functions SYSTEM "functions.sgml">
|
||||
<!ENTITY examples SYSTEM "examples.sgml">
|
||||
|
||||
<!-- I'm lazy -->
|
||||
<!ENTITY usb "<acronym>USB</acronym>">
|
||||
]>
|
||||
|
||||
<book id="manual">
|
||||
<title>libusb Developers Guide</title>
|
||||
<bookinfo>
|
||||
<author>
|
||||
<firstname>Johannes</firstname>
|
||||
<surname>Erdfelt</surname>
|
||||
</author>
|
||||
<affiliation>
|
||||
<address><email>johannes@erdfelt.com</email></address>
|
||||
</affiliation>
|
||||
|
||||
<revhistory>
|
||||
<revision>
|
||||
<revnumber>0.3</revnumber>
|
||||
<date>June 28, 2002</date>
|
||||
<authorinitials>jerdfelt</authorinitials>
|
||||
<revremark>More cleanups. Add the rest of the API and clean up some places. Add some examples. Hopefully, this should document the entire 0.1 API now.</revremark>
|
||||
</revision>
|
||||
|
||||
<revision>
|
||||
<revnumber>0.2</revnumber>
|
||||
<date>June 11, 2002</date>
|
||||
<authorinitials>jerdfelt</authorinitials>
|
||||
<revremark>Cleanup, update for all of the changes that have happened in the last couple of months.</revremark>
|
||||
</revision>
|
||||
|
||||
<revision>
|
||||
<revnumber>0.1</revnumber>
|
||||
<date>August 26, 2001</date>
|
||||
<authorinitials>jerdfelt</authorinitials>
|
||||
<revremark>First stab.</revremark>
|
||||
</revision>
|
||||
</revhistory>
|
||||
|
||||
<keywordset>
|
||||
<keyword>libusb</keyword>
|
||||
</keywordset>
|
||||
</bookinfo>
|
||||
|
||||
<preface id="preface">
|
||||
<title>Preface</title>
|
||||
|
||||
<abstract>
|
||||
<simpara>This document's purpose is to explain the API for libusb and how to use it to make a &usb; aware application</simpara>
|
||||
<simpara>Any suggestions, corrections and comments regarding this document can be sent to the author: <ulink url="mailto:johannes@erdfelt.com">Johannes Erdfelt</ulink> or the <ulink url="mailto:libusb-devel@lists.sourceforge.net">libusb developers mailing list</ulink>.</simpara>
|
||||
</abstract>
|
||||
</preface>
|
||||
|
||||
<part id="intro">
|
||||
&intro;
|
||||
</part>
|
||||
|
||||
<part id="api">
|
||||
&api;
|
||||
</part>
|
||||
|
||||
<part id="functions">
|
||||
&functions;
|
||||
</part>
|
||||
|
||||
<part id="examples">
|
||||
&examples;
|
||||
</part>
|
||||
</book>
|
||||
@@ -0,0 +1,197 @@
|
||||
<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
|
||||
<!entity docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN" CDATA DSSSL>
|
||||
]>
|
||||
|
||||
<!--
|
||||
|
||||
Document: website.dsl
|
||||
Version: 0.2
|
||||
|
||||
Author: Johannes Erdfelt <johannes@erdfelt.com>
|
||||
|
||||
This stylesheet handles the website (html) and rtf/ps (print) stylesheets
|
||||
|
||||
-->
|
||||
|
||||
<style-sheet>
|
||||
|
||||
<style-specification id="print" use="docbook">
|
||||
<style-specification-body> ;; ==============================
|
||||
;; customize the print stylesheet
|
||||
;; ==============================
|
||||
|
||||
(declare-characteristic preserve-sdata?
|
||||
;; this is necessary because right now jadetex does not understand
|
||||
;; symbolic entities, whereas things work well with numeric entities.
|
||||
"UNREGISTERED::James Clark//Characteristic::preserve-sdata?"
|
||||
#f)
|
||||
|
||||
(define %generate-article-toc%
|
||||
;; Should a Table of Contents be produced for Articles?
|
||||
#t)
|
||||
|
||||
(define (toc-depth nd)
|
||||
2)
|
||||
|
||||
(define %generate-article-titlepage-on-separate-page%
|
||||
;; Should the article title page be on a separate page?
|
||||
#t)
|
||||
|
||||
(define %section-autolabel%
|
||||
;; Are sections enumerated?
|
||||
#t)
|
||||
|
||||
(define %footnote-ulinks%
|
||||
;; Generate footnotes for ULinks?
|
||||
#f)
|
||||
|
||||
(define %bop-footnotes%
|
||||
;; Make "bottom-of-page" footnotes?
|
||||
#f)
|
||||
|
||||
(define %body-start-indent%
|
||||
;; Default indent of body text
|
||||
0pi)
|
||||
|
||||
(define %para-indent-firstpara%
|
||||
;; First line start-indent for the first paragraph
|
||||
0pt)
|
||||
|
||||
(define %para-indent%
|
||||
;; First line start-indent for paragraphs (other than the first)
|
||||
0pt)
|
||||
|
||||
(define %block-start-indent%
|
||||
;; Extra start-indent for block-elements
|
||||
0pt)
|
||||
|
||||
(define formal-object-float
|
||||
;; Do formal objects float?
|
||||
#t)
|
||||
|
||||
(define %hyphenation%
|
||||
;; Allow automatic hyphenation?
|
||||
#t)
|
||||
|
||||
(define %admon-graphics%
|
||||
;; Use graphics in admonitions?
|
||||
#f)
|
||||
|
||||
</style-specification-body>
|
||||
</style-specification>
|
||||
|
||||
|
||||
<!--
|
||||
;; ===================================================
|
||||
;; customize the html stylesheet; borrowed from Cygnus
|
||||
;; at http://sourceware.cygnus.com/ (cygnus-both.dsl)
|
||||
;; ===================================================
|
||||
-->
|
||||
|
||||
|
||||
<style-specification id="html" use="docbook">
|
||||
<style-specification-body>
|
||||
|
||||
|
||||
;; =========================
|
||||
;; Indexes
|
||||
|
||||
;; Returns the depth of the auto-generated TOC (table of contents) that
|
||||
;; should be made at the nd-level
|
||||
(define (toc-depth nd)
|
||||
(if (string=? (gi nd) "book")
|
||||
2 ; the depth of the top-level TOC
|
||||
2 ; the depth of all other TOCs
|
||||
))
|
||||
|
||||
(define %page-n-columns%
|
||||
;; Sets the number of columns on each page
|
||||
2)
|
||||
|
||||
(define %generate-article-toc%
|
||||
#t)
|
||||
|
||||
|
||||
(define %header-navigation%
|
||||
#t)
|
||||
|
||||
(define %footer-navigation%
|
||||
#t)
|
||||
|
||||
(define %gentext-nav-use-tables%
|
||||
#t)
|
||||
|
||||
(define %gentext-nav-tblwidth%
|
||||
"100%")
|
||||
|
||||
|
||||
(define %indent-programlisting-lines%
|
||||
" ")
|
||||
|
||||
(define %indent-screen-lines%
|
||||
" ")
|
||||
|
||||
(define %shade-verbatim%
|
||||
#t)
|
||||
|
||||
(define ($shade-verbatim-attr$)
|
||||
(list
|
||||
(list "BORDER" "0")
|
||||
(list "BGCOLOR" "#E0E0E0")
|
||||
(list "WIDTH" ($table-width$))))
|
||||
|
||||
(define %callout-default-col%
|
||||
70)
|
||||
|
||||
(define biblio-number
|
||||
#t)
|
||||
|
||||
(define %graphic-default-extension%
|
||||
"jpg")
|
||||
|
||||
(define %graphic-extensions%
|
||||
'("gif" "jpg" "jpeg" "png" "tif" "tiff" "eps" "epsf"))
|
||||
|
||||
(define %stylesheet%
|
||||
"/base.css")
|
||||
|
||||
(define %stylesheet-type%
|
||||
"text/css")
|
||||
|
||||
(define %use-id-as-filename%
|
||||
#t)
|
||||
|
||||
(define use-output-dir
|
||||
#t)
|
||||
|
||||
(define %output-dir%
|
||||
"html")
|
||||
|
||||
(define %html-ext%
|
||||
".html")
|
||||
|
||||
(define %root-filename%
|
||||
"index")
|
||||
|
||||
(define %html-use-lang-in-filename%
|
||||
#f)
|
||||
|
||||
(define %html40%
|
||||
#t)
|
||||
|
||||
(define %fix-para-wrappers%
|
||||
#t)
|
||||
|
||||
(define %section-autolabel%
|
||||
#t)
|
||||
|
||||
(define (chunk-skip-first-element-list)
|
||||
'())
|
||||
|
||||
</style-specification-body>
|
||||
</style-specification>
|
||||
|
||||
<external-specification id="docbook" document="docbook.dsl">
|
||||
|
||||
</style-sheet>
|
||||
|
||||
Reference in New Issue
Block a user