Is it possible to find USB Class ID from Vendor/Product ID?

1

I'm attempting to create a list of all the USB devices that we have in use. To do this I created a mini shell script that read from the sysfs (these are Linux thin clients). I was able to get a good list of vendor/product IDs, however it looks like the Class ID for them are all set to 00, as in it's telling me to look at interface descriptors (not sure if that means Vendor/Product ID?)

My question is if there's any way to determine a USB Device Class from Vendor/Product ID? I have seen a few different places to search these, but none that seem to correlate Vendor/Product ID with a Class, I can just look up one or the other.

https://www.usb.org/defined-class-codes

http://www.linux-usb.org/usb-ids.html

https://www.the-sz.com/products/usbid/

4oo4

Posted 2020-02-24T21:13:17.157

Reputation: 13

Answers

2

Maybe you would be better served with lsusb? Run lsusb -v to get output that would look something like this:

Bus 004 Device 006: ID 0a5c:2110 Broadcom Corp.
  bDeviceClass          224 Wireless
  bDeviceProtocol         1 Bluetooth
  iProduct                2 BCM2045B

Should give you all the information you need without having to do any extra lookup steps.

sippybear

Posted 2020-02-24T21:13:17.157

Reputation: 294

Thanks, I think I was looking at that originally as one way to gather the info, I might take another stab at that. I'll just have to parse the results a different way. Was hoping to not have to run a scraping script on them again and am surprised that there's no public mapping for those, but oh well. – 4oo4 – 2020-02-25T01:18:28.470

Doesn't lsusb just read the same /sys attributes? – user1686 – 2020-02-25T05:51:47.657