=====為什么編輯一次以后,空格都成了問號呢,請忽略問號的存在====
還請老師給完善下代碼,十分感謝~~~
以微軟或羅技優(yōu)聯(lián)的接收器為例,
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;