Overview
libusb 是一个 C 语言库,提供对 USB 设备的通用访问。其目的是供开发人员使用,以方便开发与 USB 硬件通信的应用程序。
它具有可移植性: 它使用单一的跨平台 API,可访问 Linux、macOS、Windows 等平台上的 USB 设备。
它使用的是用户模式: 应用程序与设备通信时无需特殊权限或提升权限。
它是版本无关的: 支持从 1.0 到 3.1(最新)的所有 USB 协议版本。
libusb is a C library that provides generic access to USB devices. It is intended to be used by developers to facilitate the production of applications that communicate with USB hardware.
It is portable: Using a single cross-platform API, it provides access to USB devices on Linux, macOS, Windows, etc.
It is user-mode: No special privilege or elevation is required for the application to communicate with a device.
It is version-agnostic: All versions of the USB protocol, from 1.0 to 3.1 (latest), are supported.
如果你使用的是 Linux,你的发行版很可能已经包含 libusb,因此您可能只需在源代码中引用 libusb 头文件即可。
对于其他平台,或者如果您想使用最新版本,建议您从源代码重新编译。请查看下载菜单。
如果您愿意,也可以直接从 github 访问源代码。(GitHub - libusb/libusb: A cross-platform library to access USB devices)
确保能够访问库及其头文件后,请查看 libusb API 或 libusb 示例。(libusb: libusb-1.0 API Reference) (https://github.com/libusb/libusb/tree/master/examples)
If you are using Linux, chances are your distribution already includes libusb, so you probably just need to reference the libusb header in your source.
For other platforms, or if you want to use the very latest, you are encouraged to recompile from source. Please check the Downloads menu.
If you prefer, you can also access the source directly from github.
Once you have secured your access to the library and its header, please check the libusb API or the libusb samples.
libusb (1.0)
GitHub - libusb/libusb: A cross-platform library to access USB devices
libusb 是一个用于访问 USB 设备的库,支持Linux、macOS、Windows (Vista and newer)、OpenBSD/NetBSD、Haiku、Solaris 用户空间和 WebAssembly的WebUSB等多种访问 。它由 C 语言编写(Haiku 后端由 C++ 编写),采用 GNU Lesser General Public License 2.1 版本或更高版本授权。
libusb 经过内部抽象,方便移植到其他操作系统。更多信息,请参阅 PORTING 文件。
libusb is a library for USB device access from Linux, macOS, Windows (Vista and newer), OpenBSD/NetBSD, Haiku, Solaris userspace, and WebAssembly via WebUSB. It is written in C (Haiku backend in C++) and licensed under the GNU Lesser General Public License version 2.1 or, at your option, any later version.
libusb is abstracted internally in such a way that it can hopefully be ported to other operating systems. Please see the PORTING file for more information.
libusb homepage: libusb
Developers will wish to consult the API documentation: http://api.libusb.info
Use the mailing list for questions, comments, etc: http://mailing-list.libusb.info
(Please use the mailing list rather than mailing developers directly)
libusb-compat-0.1
GitHub - libusb/libusb-compat-0.1: Working tree for libusb-compat-0.1
一个兼容层,允许为 libusb-0.1 编写的应用程序与 libusb-1.0 兼容。
libusb-compat-0.1 试图在外观、感觉和行为方面与 libusb-0.1 相似。
请勿尝试在同一系统上安装 libusb-0.1 和 libusb-compat-0.1。
libusb homepage:
Use the mailing list for questions, comments, etc: