=====为什么编辑一次以后,空格都成了问号呢,请忽略问号的存在====
还请老师给完善下代码,十分感谢~~~
以微软或罗技优联的接收器为例,
GetU2DevDescr:?
x12 x01 x00 x02 x00 x00 x00 x20 x6D x04 x2B xC5 x11 x24 x01 x02 x00 x01
GetU2CfgDescr:?
x09 x02 x54 x00 x03 x01 x04 xA0 x31? ? ? ?-- 3个设备?
x09 x04 x00 x00 x01 x03 x01 x01 x00? ? ? ?-- 键盘
x09 x21 x11 x01 x00 x01 x22 x3B x00?
x07 x05 x81 x03 x08 x00 x08?
x09 x04 x01 x00 x01 x03 x01 x02 x00? ? ? ?-- 鼠标?
x09 x21 x11 x01 x00 x01 x22 x94 x00?
x07 x05 x82 x03 x08 x00 x02?
x09 x04 x02 x00 x01 x03 x00 x00 x00?
x09 x21 x11 x01 x00 x01 x22 x62 x00?
x07 x05 x83 x03 x20 x00 x02
看代码只能识别第一个接口,并没有识别后面的接口
typedef?struct?__PACKED?_USB_CONFIG_DESCR?{ ????UINT8?bLength; ????UINT8?bDescriptorType; ????UINT16?wTotalLength; ????UINT8?bNumInterfaces; ????UINT8?bConfigurationValue; ????UINT8?iConfiguration; ????UINT8?bmAttributes; ????UINT8?MaxPower; }?USB_CFG_DESCR,?*PUSB_CFG_DESCR; typedef?struct?__PACKED?_USB_INTERF_DESCR?{ ????UINT8?bLength; ????UINT8?bDescriptorType; ????UINT8?bInterfaceNumber; ????UINT8?bAlternateSetting; ????UINT8?bNumEndpoints; ????UINT8?bInterfaceClass; ????UINT8?bInterfaceSubClass; ????UINT8?bInterfaceProtocol; ????UINT8?iInterface; }?USB_ITF_DESCR,?*PUSB_ITF_DESCR; typedef?struct?__PACKED?_USB_ENDPOINT_DESCR?{ ????UINT8?bLength; ????UINT8?bDescriptorType; ????UINT8?bEndpointAddress; ????UINT8?bmAttributes; ????UINT16?wMaxPacketSize; ????UINT8?bInterval; }?USB_ENDP_DESCR,?*PUSB_ENDP_DESCR; typedef?struct?__PACKED?_USB_CONFIG_DESCR_LONG?{ ????USB_CFG_DESCR???cfg_descr; ????USB_ITF_DESCR???itf_descr; ????USB_ENDP_DESCR??endp_descr[1]; }?USB_CFG_DESCR_LONG,?*PUSB_CFG_DESCR_LONG;