know a usb device's endpoint

Vulpo picture Vulpo · May 7, 2013 · Viewed 17.8k times · Source

Is there a bash command, a program or a libusb function (although I did not find one) which indicates me what are the OUT or IN endpoints of a usb device ?

For example, bNumEndpoints of libusb_interface_descriptor (from libusb1.0 library) shows me my usb drive has 3 endpoints, but how can I know what is their idnumber ?

Answer

eatonphil picture eatonphil · Jul 16, 2013

After you have claimed the device, run this (where $ represents the terminal entry point):

$ sudo lsusb -v -d 16c0:05df

Where 16c0:05df are your vendor and product ids separated by a colon. (If you don't know these, type lsusb and figure out which device is yours by unplugging and re-running lsusb)

If you get confused use the lsusb man page:

http://linux.die.net/man/8/lsusb

Then once your description comes up, find the line labeled bEndpointAddress and the hex code following will be the endpoint for that specific Report.