Libusb get report descriptor error on imx6dl

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Libusb get report descriptor error on imx6dl

Jump to solution
1,491 Views
Mihan
Contributor IV

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

Labels (2)
Tags (1)
0 Kudos
1 Solution
1,416 Views
Mihan
Contributor IV

Ok, my mistake. I forget to check the kernal device is active on an interface or not. Now I can get the report descriptor.

View solution in original post

0 Kudos
3 Replies
1,416 Views
b36401
NXP Employee
NXP Employee

It seems the device does not support the command was sent from host.

0 Kudos
1,417 Views
Mihan
Contributor IV

Ok, my mistake. I forget to check the kernal device is active on an interface or not. Now I can get the report descriptor.

0 Kudos
1,416 Views
Mihan
Contributor IV

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?

0 Kudos