Differences from libusb v0.1.x

OpenUSB Developers Guide
Prev |  | Next

# Chapter 3. Differences from libusb v0.1.x

There are many differences from libusb v0.1, all intended to make the API cleaner and support more commonly requested features. These include:

- Completely redesigned enumeration scheme. New APIs are presented to search and manage bus and device. New APIs also have the ability to notify application about dynamic enents, like device attaching/removing.

- Cleaned up API. New APIs are more concise and universal.

- Multi-thread support. This is one of the most significant changes of libusb1.0/OpenUSB APIs. The new APIs are MT-safe and can satisfy requirements of mutli-thread applications.

- Asynchronous support. In v0.1, all functions were synchronous. While this was the most common usage, there are cases where an asynchronous interface was desirable. The API now supports asynchronous versions of most functions where it makes sense.

- More transfer types. libusb v0.1 only supported control and bulk, and control didn't support any endpoints other than the default control pipe. libusb v1.0/OpenUSB now supports all 4 types of transfers (control, bulk, interrupt and isochronous) on all endpoints.

- Normalization of return types. All functions return >= 0 on success or < 0 on error now. The error number and meaning of an error code are unified across platforms.

- OpenUSB is broken into two part,frontend and backend. The frontend is common on all platforms and exports libusb 1.0/OpenUSB APIs to application. The backend is OS specific part, which is the engine behind frontend on different platforms and not visible to application. There's a defined internal interface between frontend and backend. Backend developers can easily implement a new backend for a platform by this interface.

- To make libusb1.0/OpenUSB backward compatible with libusb 0.1.x. An emulation layer is implemented in OpenUSB. Thus, existing applications based on libusb 0.1 do not need any change. All functions in libusb 1.0/OpenUSB API have openusb_ prefix. There's no possible name conflict between libusb 1.0/OpenUSB and libusb 0.1.x. New application can choose to use features of libusb 1.0/OpenUSB or 0.1.x on a single OpenUSB library.

Prev | Home | Next
Current OS support | Up | API