我目前在做usbhost代码。目前遇到几个问题,感觉上比较奇怪,想不通。 下面是我通过ms的usbview抓到的三个usb设备的情况。
第一个是一个usb1.1协议的清华同方的u盘的结果。 Device Descriptor: bcdUSB: 0x0110 bDeviceClass: 0x00 bDeviceSubClass: 0x00 bDeviceProtocol: 0x00 bMaxPacketSize0: 0x40 (64) idVendor: 0x0204 idProduct: 0x6025 bcdDevice: 0x0100 iManufacturer: 0x00 iProduct: 0x00 iSerialNumber: 0x00 bNumConfigurations: 0x01
ConnectionStatus: DeviceConnected Current Config Value: 0x01 Device Bus Speed: Full Device Address: 0x02 Open Pipes: 2
Endpoint Descriptor: bEndpointAddress: 0x01 Transfer Type: Bulk wMaxPacketSize: 0x0040 (64) bInterval: 0x01
Endpoint Descriptor: bEndpointAddress: 0x81 Transfer Type: Bulk wMaxPacketSize: 0x0040 (64) bInterval: 0x00
第二个是一个256m的朗科的u盘
Device Descriptor: bcdUSB: 0x0200 bDeviceClass: 0x00 bDeviceSubClass: 0x00 bDeviceProtocol: 0x00 bMaxPacketSize0: 0x40 (64) idVendor: 0x0DD8 idProduct: 0xD202 bcdDevice: 0x0100 iManufacturer: 0x01 iProduct: 0x02 iSerialNumber: 0x03 bNumConfigurations: 0x01
ConnectionStatus: DeviceConnected Current Config Value: 0x01 Device Bus Speed: Full Device Address: 0x01 Open Pipes: 2
Endpoint Descriptor: bEndpointAddress: 0x02 Transfer Type: Bulk wMaxPacketSize: 0x0200 (512) bInterval: 0x00
Endpoint Descriptor: bEndpointAddress: 0x82 Transfer Type: Bulk wMaxPacketSize: 0x0200 (512) bInterval: 0x00
第三个是一个罗技鼠标的情况: Device Descriptor: bcdUSB: 0x0200 bDeviceClass: 0x00 bDeviceSubClass: 0x00 bDeviceProtocol: 0x00 bMaxPacketSize0: 0x08 (8) idVendor: 0x046D (Logitech Inc.) idProduct: 0xC018 bcdDevice: 0x4301 iManufacturer: 0x01 iProduct: 0x02 iSerialNumber: 0x00 bNumConfigurations: 0x01
ConnectionStatus: DeviceConnected Current Config Value: 0x01 Device Bus Speed: Low Device Address: 0x01 Open Pipes: 1
Endpoint Descriptor: bEndpointAddress: 0x81 Transfer Type: Interrupt wMaxPacketSize: 0x0005 (5) bInterval: 0x0A
大家注意到没有,上面三个设备的endpoint要么是 01 要么是81,就是说同一个设备的的endpoint的编号都是相同的,只是方向不同而已。这是怎末回事,不是说每个除了编号0以外的端点都是要么只能IN,要么只能out的吗?那我主机该怎么办呢?也都从这个相同的端口进出数据吗? 我是第一次做usb开发,有点想不通。请大侠帮忙解决下我的疑问,谢谢了。
|