NameDateSize

..30-Jun-201839

bulk.cH A D18-Aug-20165.7 KiB

control.cH A D18-Aug-20169.1 KiB

MakefileH A D18-Aug-2016300

READMEH A D18-Aug-20161.7 KiB

util.cH A D18-Aug-20161.2 KiB

util.hH A D18-Aug-2016578

README

1As I dug my own way through the documentation of libusb 2.0 that ships
2with FreeBSD 8+ as the OS'es own USB library API, I noticed there are
3only few code examples around under /usr/src (namely, usbconfig
4itself).
5
6The libusb20(3) man page is a starting point, but it's a reference
7manual, nothing less, nothing more.  Using just a reference, it's not
8very easy to start writing your own code based on that.
9
10So I started writing my own examples, to "get a feeling" about how to
11use the library.  I covered two typical scenarios which are common for
12a number of devices.
13
14The first one is called "bulk", and uses bulk output (host to device)
15and input transfers to talk to an USB device.
16
17The second one is called "control", and can use both control output
18and input transfers, as well as so-called interrupt transfers.  The
19latter are used for data that are being reported frequently or
20repeatedly, like position updates from a pointing device (mouse).
21Despite of its name, the host has to poll devices for their interrupt
22transfers on each USB frame (i.e., each 1 ms).
23
24Recommended reading is the USB 3.0 specification (the older 2.0 one
25would do as well), to be found under
26
27http://www.usb.org/developers/docs/
28
29as well as documents for individual USB device classes where
30appropriate.
31
32Feel free to be liberal in the licensing of these examples: while the
33beer-ware license mandates to keep the license notice, this only
34applies to modifications of the original examples itself.  For
35copy&pasting (even a larger) piece of an example into your own work, I
36won't imply you have to reproduce the beer-ware license text there.
37Feel free to credit my name in your derived work if you want.
38
39Dresden, July 2012
40Joerg Wunsch <joerg@FreeBSD.org>
41
42# $FreeBSD$
43