| Version 36 (modified by xiaofan, 14 months ago) (diff) |
|---|
libusb
libusb
Welcome
libusb is a C library which gives applications easy access to USB devices on many different operating systems. libusb is an open source project, the code is licensed under the GNU Lesser General Public License version 2.1.
Version overview
There are two libusb API versions:
- libusb-1.0 is the current version, under active development
- libusb-0.1 is the original version which is deprecated and unmaintained since many years
- libusb-compat-0.1 is a compatibility library which provides the libusb-0.1 API by using libusb-1.0
The different API versions do not conflict, so they can be installed in parallell on a system. However, if you have installed libusb-1.0 then we strongly recommend to use libusb-compat-0.1 instead of the ancient libusb-0.1 code, so that programs which use both the 0.1 API and the 1.0 API in different parts of the program, or in different libraries used by the program, will both end up using libusb-1.0 for actual device access. This is important to avoid potential conflicts between libusb-1.0 and libusb-0.1 being used by the same process.
In addition to the above libraries by the libusb project there is also a separate project which provides the libusb-0.1 API on Windows:
- libusb-win32 (It is a separate project, but several contributors participate in both libusb and libusb-win32.)
Current API version: libusb-1.0
Daniel Drake adopted the project in January 2008 and worked on the libusb-1.0 API and implementation, which adds several features missing in the 0.1 API. libusb-1.0 is the recommended version to use for all new development. Developers are encouraged to port existing applications which use libusb-0.1 to use the new API.
- See the libusb-1.0 page for more detailed information about libusb-1.0
- Download libusb-1.0 releases here
- libusb-1.0 API documentation
- Linux, Mac OS X, Windows and OpenBSD are currently supported.
- FreeBSD includes a separate implementation of the libusb-0.1 and libusb-1.0 APIs in the system libc.
- The Windows backend currently depends on the generic USB device driver WinUSB.sys by Microsoft, which is included with all Windows versions starting with Windows Vista. There is a ticket about support for the libusb0.sys kernel driver developed by the libusb-win32 project.
A device driver which supports libusb must always be used for the device on every operating system. Each operating system has different rules for device drivers. On Mac OS X, if an interface driver included with the OS matches the characteristics of a device, that driver will seize the interface, and the driver cannot be detached by libusb, so libusb will not be able to use that interface.
libusb is not suited for accessing HID class devices. It is recommended to use HIDAPI instead, for convenient and cross-platform access to HID class devices.
Legacy API: libusb-0.1
Johannes Erdfelt founded the libusb project and lead development through 2007. By then, libusb-0.1 had stabilized, and was adopted by a wide range of projects.
- Last release: libusb-0.1.12
- Supported operating systems: Linux, FreeBSD, NetBSD, OpenBSD, Darwin, MacOS X (and Windows, through the libusb-win32 project).
- Development status: libusb-0.1 is deprecated and will have no further changes or releases
- Note that libusb-win32 is a separate project which still sees active development. The next generation libusb-win32 kernel driver (libusbk.sys) is based on KMDF. The libusbk library will support the existing libusb-win32 API, libusb-1.0 API and WinUSB-like API. libusb-win32 users who are fine with the libusb-win32 API are recommended to keep using it since it will be supported by the libusb-win32 project. libusb-win32 users who are interested in libusb-1.0 will also be supported once the libusbk backend is integrated. Future enhancement of the libusb-1.0 API (say libusb-1.1) may be required to be more suitable for Windows users.
- Download libusb-0.1 releases here
- libusb-0.1 API documentation
- Unofficial bindings at the libusb-win32 site
- Projects and Examples using libusb-win32
Support
Please read the FAQ (Frequently Asked Questions) page to see if your question has already been answered.
Please ask unanswered questions on the mailing list or in the IRC channel. Remember to search for an answer on your own, before asking others for help.
Bugs and feature requests
If you find a bug in libusb, libusb-compat-0.1, or another related program, or if you wish to request an enhancement, please verify that the bug still exists in the newest code, and then please create a new ticket on this web page.
We require that you register an account and verify your email address before you can create a ticket, in an attempt to reduce the amount of spam that gets into the system. We are sorry for this inconvenience, but registering is quick and simple so please don't let it stop you.
Make sure to view the list of active tickets before creating a new ticket, so that duplicates can be avoided.
Thank you for helping make libusb even better!
Related
- usbutils includes the very useful lsusb program to view descriptors in devices
License of the Wiki Content
Creative Commons CC BY-SA 3.0