mirror of
https://github.com/RPCS3/libusb.git
synced 2026-07-21 00:16:04 -04:00
871eb299b989bc0714391804a9d2fdb145a32ff5
This fixes the output of libusb_get_port_numbers(), where it used to merely return the port number of the device itself. Now that libusb properly detects parent devices, we get the entire port path of the device. For reference, here's the output of the 'listdevs' example before my changes: tich-mbp:libusb-1.0.21 tich$ ./examples/listdevs 0409:005a (bus 29, device 6) path: 1 05ac:8509 (bus 26, device 2) path: 1 05ac:821d (bus 29, device 7) path: 3 05ac:0252 (bus 29, device 5) path: 3 05ac:8242 (bus 29, device 4) path: 2 0a5c:4500 (bus 29, device 3) path: 1 0424:2513 (bus 29, device 2) path: 8 8087:0024 (bus 29, device 1) path: 1 8087:0024 (bus 26, device 1) path: 1 And here's the output after my changes: tich-mbp:libusb-1.0.21 tich$ ./examples/listdevs 0409:005a (bus 29, device 6) path: 1.1 05ac:8509 (bus 26, device 2) path: 1.1 05ac:821d (bus 29, device 7) path: 1.8.1.3 05ac:0252 (bus 29, device 5) path: 1.8.3 05ac:8242 (bus 29, device 4) path: 1.8.2 0a5c:4500 (bus 29, device 3) path: 1.8.1 0424:2513 (bus 29, device 2) path: 1.8 8087:0024 (bus 29, device 1) path: 1 8087:0024 (bus 26, device 1) path: 1 Since we're now using "IOUSBHostDevice" as the matching service (starting with El Capitan), we need to walk up the IOService plane to look for parents. You can manually walk up the IOService plane by executing "ioreg -p IOService -l -w 0 -x | less" and looking for your device. Notice that the parent device is always a parent in the tree, but it's not always the _immediate_ parent of the device.
libusb
libusb is a library for USB device access from Linux, Mac OS X, Windows, OpenBSD/NetBSD and Haiku userspace. 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 (see COPYING).
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: http://libusb.info/
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
- Hans de Goede hdegoede@redhat.com
- Xiaofan Chen xiaofanc@gmail.com
- Ludovic Rousseau ludovic.rousseau@gmail.com
- Nathan Hjelm hjelmn@cs.unm.edu
- Chris Dickens christopher.a.dickens@gmail.com
(Please use the mailing list rather than mailing developers directly)
Description
Languages
C
91.7%
C++
3.1%
CMake
1.6%
Batchfile
1.1%
Makefile
1%
Other
1.5%