Hi
I want to check out the usb hotplug event and get the information of device on my program,so I usb libusb.
But when I use "libusb_get_descriptor" for the report descriptor, it returns LIBUSB_ERROR_PIPE.
I need to know what kinds of the device they are, I can get their string of product , device descriptor and so on but the report descriptor.
The author of libusb said "Descriptor access all happens over the control pipe. I think it's running on on linux but some system configurations are different."
Could you give me a hand about that? I'm using the 4.1.15 kernel.
Regards
Mihan
Solved! Go to Solution.
Ok, my mistake. I forget to check the kernal device is active on an interface or not. Now I can get the report descriptor.
It seems the device does not support the command was sent from host.
Ok, my mistake. I forget to check the kernal device is active on an interface or not. Now I can get the report descriptor.
But I just usb libusb_get_descriptor to get the report descriptor, to analyze the HID device.
Because I can get the HID descriptor (e.g. 09 21 1101 00 01 22 4f00) but why I can't get this 79 byte of report descriptor?
Also I try to use libusb_control_transfer
e.g.
libusb_control_transfer(handle,
LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_STANDARD | LIBUSB_RECIPIENT_INTERFACE,
LIBUSB_REQUEST_GET_DESCRIPTOR,
(LIBUSB_DT_REPORT << 8),
0,
buf, 2014,
5000);
but it doesn't work ,with LIBUSB_ERROR_IO returned.
So do you have other ways to analyze a usb device which is a mouse or a keyboard?