wiki:libusb-1.0

Version 18 (modified by xiaofan, 3 years ago) (diff)

--

libusb-1.0

libusb-1.0 is an almost-rewrite of the previous stable branch, libusb-0.1. It is a lightweight library that can be efficiently integrated into applications of any kind, with several new features.

libusb-1.0 development is being lead by Daniel Drake. Contributions encouraged!

Down is the new up

Confusingly, another development branch of libusb was created a while ago, also named libusb-1.0. This branch never reached maturity and will not be developed further, although it was forked to form the OpenUSB project. The library you are reading about here can be viewed as a completely different implementation.

Status

The library is complete. New releases will primarily be for bug-fixes. Internal cleanups/improvements and new features (API additions, but not modifications) will be implemented in Libusb1.1?.

Download

Projects using libusb-1.0

Bindings for other languages

Development

Development happens in a git repository: git://git.libusb.org/libusb.git (gitweb interface)

Contributions encouraged - please either email patches to the libusb-devel mailing list, or publish your git tree somewhere and email a pull request to the mailing list.

Portability

libusb-1.0 includes a platform abstraction layer allowing for cross-platform compatibility. Linux and Darwin (Mac OS X) are supported in the latest release.

FreeBSD 8 includes a FreeBSD-specific reimplementation of the libusb-1.0 API, so your applications will probably work there too. The source code for this library can be found here.

If you are interested in porting to other platforms, the PORTING file tells you where to start. We are more than happy to help out here, please write to the mailing list with your questions and feedback.

Documentation

doxygen comments are present in the source and the generated HTML documentation can be found at http://libusb.sourceforge.net/api-1.0/

Feedback is appreciated.

Backwards compatibility

libusb-1.0 is not backwards compatible with libusb-0.1 - all function names are different, etc. However, libusb-1.0 is designed to be happily installable alongside libusb-0.1 (even in the default configuration) so the lack of backwards compatibility is not really a problem - users can have both libusb versions present on the same system without conflict.

That said, a libusb-compat-0.1 compatibility layer? does exist. This is a "wrapper" which converts libusb-0.1 function calls to their 1.0 equivalents. For more info, see LibusbCompat0.1?.

Mailing list

The libusb-devel mailing list exists for both users of the library, plus developers interested in contributing to the library itself.


Comparisons to other USB libraries

libusb-0.1

libusb-0.1 is the very popular predecessor of this project.

Advantages compared to libusb-1.0

  • Portable to a larger number of operating systems
  • Widespread adoption

Disadvantages compared to libusb-1.0

  • Does not provide isochronous endpoint I/O
  • Does not provide asynchronous I/O
  • Not being developed further

OpenUSB

OpenUSB is a fork of a never-released development branch of libusb, confusingly also named libusb-1.0.

Advantages compared to libusb-1.0

  • Portable to a larger number of operating systems

Disadvantages compared to libusb-1.0

  • Does not expose pollable file descriptors (and it would not be realistic to offer this functionality without a lot of rework)
  • Creates a number of internal threads for each process that uses it
  • In my opinion, more complex than it needs to be (largely due to the complexity of threading)