Question

On a Linux system, I need to list all USB hosts and devices with various information like class, product id, etc. I figure both libusb and sysfs are up to the task (correct?). So which one is the better?

Was it helpful?

Solution

You should prefer libusb because it is platform independent and provides better APIs to work with USB devices than sysfs.

If you do not need to integrate this functionality in some other program, consider using the standalone usb-devices or even lsusb programs (which are included with the usbutils package).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top