Add -t option to listdevs example
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
Start with the examples/listdevs example mentioned in the issue and compare its current output with the device paths shown. Add a -t option that displays the device topology; done when the example accepts that option and presents the connected devices in a tree-style view.
Written by the indexing model from the issue text.
Description
I need to use alternative lsusb utility pretty often under macOS since lsusb -t from usbutils does not work out of Linux.
mcuee in ~/build/libusb/libusb on master % lsusb
Bus 000 Device 001: ID 05ac:8015
Bus 000 Device 002: ID 05e3:0625
Bus 000 Device 003: ID 05e3:0610
Bus 000 Device 004: ID 16c0:05dc
Bus 000 Device 006: ID 0bda:8156
Bus 000 Device 007: ID 05e3:0747
Bus 000 Device 008: ID 04b4:8613
mcuee in ~/build/libusb/libusb on master % lsusb -t
Usage: lsusb [options]...
List USB devices
-v, --verbose
Increase verbosity (show descriptors)
-s [[bus]:][devnum]
Show only devices with specified device and/or
bus numbers (in decimal)
-d vendor:[product]
Show only devices with the specified vendor and
product ID numbers (in hexadecimal)
-D device
Selects which device lsusb will examine
-V, --version
Show version of program
-h, --help
Show usage and help
mcuee in ~/build/libusb/libusb on master % ./build_git/examples/listdevs
04b4:8613 (bus 0, device 8) path: 1.2.2
05e3:0747 (bus 0, device 7) path: 2.4
0bda:8156 (bus 0, device 6) path: 2.3
05e3:0625 (bus 0, device 2) path: 2
16c0:05dc (bus 0, device 4) path: 1.2.1
05e3:0610 (bus 0, device 3) path: 1.2
05ac:8015 (bus 0, device 1) path: 1
mcuee in ~/build/libusb/libusb on master % ./build_git/examples/testlibusb
Dev (bus 0, device 8): 04B4 - 8613 speed: 480M
Dev (bus 0, device 7): 05E3 - 0747 speed: 5G
Manufacturer: Generic
Product: USB Storage
Dev (bus 0, device 6): 0BDA - 8156 speed: 5G
Manufacturer: Realtek
Product: USB 10/100/1G/2.5G LAN
Dev (bus 0, device 2): 05E3 - 0625 speed: 10G
Manufacturer: GenesysLogic
Product: USB3.2 Hub
Dev (bus 0, device 4): 16C0 - 05DC speed: 1.5M
Manufacturer: www.fischl.de
Product: USBasp
Dev (bus 0, device 3): 05E3 - 0610 speed: 480M
Manufacturer: GenesysLogic
Product: USB2.1 Hub
Dev (bus 0, device 1): 05AC - 8015 speed: 480M
Manufacturer: Apple
Product: USB2.0 Hub```
It would be good to add `-t` option to libusb example listdev example.
- Dominant language
- C
- Stars
- 6.2k
- Forks
- 2.1k
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from libusb/libusb
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
android core
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Windows version of libusb-master (MSVC build) can't be built when git installed w/o bashPossibly taken @Youw claimed this 20 days ago. Openwindows
-
windows
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
core enhancement
Difficulty 5/5 Over a week Newbie friendliness 30/100
Similar issues
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 85/100
FujiNetWIFI/fujinet-lib#122 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 12 days
-
bug format I/O medium priority rt_lib
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100