【发布时间】:2016-12-20 21:06:15
【问题描述】:
据我们所知,我们可以使用终端通过命令 lsusb 找到 USB 端口:
$ lsusb
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 5986:02d2 Acer, Inc
Bus 001 Device 005: ID 054c:0688 Sony Corp.
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 034: ID 13fe:4100 Kingston Technology Company Inc. Flash drive
Bus 003 Device 033: ID 2500:0020
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
我还访问了网站并提出了很多建议,但它们与我上面预期的列表不太相符。
- Getting USB Device path from USB port
- https://unix.stackexchange.com/questions/61484/find-the-information-of-usb-devices-in-c
- https://askubuntu.com/questions/503928/missing-usb-h-file-what-is-it-where-do-i-get-it
- http://www.linux-usb.org/
- http://www.dreamincode.net/forums/topic/148707-introduction-to-using-libusb-10/
....等等。
我正在尝试了解如何将 USB 输入链接到 C++,但我对此感到困惑并且没有任何想法。
【问题讨论】:
-
they are kind of not working需要详细说明吗?请在某些附加上下文中 edit,例如 exactly 无法正常工作 - 关联/相关日志/控制台输出。