Libusb get report descriptor error on imx6dl

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Libusb get report descriptor error on imx6dl

跳至解决方案
2,866 次查看
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

标签 (2)
标记 (1)
0 项奖励
回复
1 解答
2,791 次查看
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 项奖励
回复
3 回复数
2,791 次查看
b36401
NXP Employee
NXP Employee

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

0 项奖励
回复
2,792 次查看
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 项奖励
回复
2,791 次查看
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 项奖励
回复