对USB组合设备的配置过程有疑问,用bushound录的数据怕不可靠,手上又没有分析仪,下面是bushound的录取数据 Bus Hound 5.00 capture. Complements of www.perisoft.net
数据传输方向
Device - Device ID (followed by the endpoint for USB devices) (7) USB Root Hub (11) USB Root Hub (13) USB Root Hub (20) USB Composite Device (21) USB 人体学输入设备 (22) USB 人体学输入设备 (23) USB 人体学输入设备 (24) HID Keyboard Device (25) HID-compliant mouse (26) 符合 HID 标准的用户控制设备 (27) HID-compliant device Phase - Phase Type CTL USB control transfer DI Data in DO Data out USTS USB status Data - Hex dump of the data transferred Descr - Description of the phase Cmd... - Position in the captured data
Device Phase Data Description Cmd.Phase.Ofs(rep) ------ ----- -------------------------------------------------- ---------------- ------------------ 13.0 CTL a3 00 00 00 04 00 04 00 GET STATUS 1.1.0(2) 13.0 DI 01 05 01 00 .... 1.2.0 13.0 CTL 23 01 10 00 04 00 00 00 CLEAR FEATURE 3.1.0 13.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 4.1.0 13.0 DI 00 05 00 00 .... 4.2.0 13.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 5.1.0 13.0 DI 00 05 00 00 .... 5.2.0 13.0 CTL a3 00 00 00 03 00 04 00 GET STATUS 6.1.0 13.0 DI 00 05 00 00 .... 6.2.0 13.0 CTL a3 00 00 00 04 00 04 00 GET STATUS 7.1.0(2) 13.0 DI 01 05 00 00 .... 7.2.0 13.0 CTL 23 03 04 00 04 00 00 00 SET FEATURE 9.1.0 13.0 CTL a3 00 00 00 04 00 04 00 GET STATUS 10.1.0 13.0 DI 00 85 11 00 .... 10.2.0 13.0 CTL 23 01 14 00 04 00 00 00 CLEAR FEATURE 11.1.0 13.0 CTL a3 00 00 00 04 00 04 00 GET STATUS 12.1.0(3) 13.0 DI 00 85 01 00 .... 12.2.0 13.0 CTL 23 01 10 00 04 00 00 00 CLEAR FEATURE 15.1.0 13.0 CTL a3 00 00 00 05 00 04 00 GET STATUS 16.1.0 13.0 DI 00 05 00 00 .... 16.2.0 13.0 CTL a3 00 00 00 06 00 04 00 GET STATUS 17.1.0 13.0 DI 00 05 00 00 .... 17.2.0 13.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 18.1.0 13.0 DI 00 05 00 00 .... 18.2.0 13.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 19.1.0 13.0 DI 00 05 00 00 .... 19.2.0 13.0 CTL a3 00 00 00 03 00 04 00 GET STATUS 20.1.0 13.0 DI 00 05 00 00 .... 20.2.0 13.0 CTL a3 00 00 00 04 00 04 00 GET STATUS 21.1.0 13.0 DI 00 85 00 00 .... 21.2.0 13.0 CTL a3 00 00 00 05 00 04 00 GET STATUS 22.1.0 13.0 DI 00 05 00 00 .... 22.2.0 13.0 CTL a3 00 00 00 06 00 04 00 GET STATUS 23.1.0 13.0 DI 00 05 00 00 .... 23.2.0 20.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 24.1.0 20.0 DI 12 01 01 01 00 00 00 10 21 ff 01 ff 00 00 00 00 ........!....... 24.2.0 00 01 .. 24.2.16 20.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 25.1.0 20.0 DI 09 02 5b 00 03 01 00 80 32 .......2 25.2.0 20.0 CTL 80 06 00 02 00 00 5b 00 GET DESCRIPTOR 26.1.0 20.0 DI 09 02 5b 00 03 01 00 80 32 09 04 00 00 02 03 01 ..[.....2....... 26.2.0 01 00 09 21 01 01 00 01 22 3f 00 07 05 82 03 10 ...!...."?...... 26.2.16 00 0a 07 05 02 03 10 00 0a 09 04 01 00 01 03 01 ................ 26.2.32 02 00 09 21 01 01 00 01 22 34 00 07 05 01 03 10 ...!...."4...... 26.2.48 00 1a 09 04 02 00 01 03 00 00 00 09 21 01 01 00 ............!... 26.2.64 01 22 51 00 07 05 81 03 10 00 0a ."Q........ 26.2.80 20.0 CTL 00 09 01 00 00 00 00 00 SET CONFIG 27.1.0 21.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 28.1.0 21.0 DO 12 01 01 01 00 00 00 10 21 ff 01 ff 00 00 00 00 ........!....... 28.2.0 00 01 .. 28.2.16 21.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 29.1.0 21.0 DO 09 02 29 00 01 01 00 80 32 ..).....2 29.2.0 21.0 CTL 80 06 00 02 00 00 29 00 GET DESCRIPTOR 30.1.0 21.0 DO 09 02 29 00 01 01 00 80 32 09 04 00 00 02 03 01 ..).....2....... 30.2.0 01 00 09 21 01 01 00 01 22 3f 00 07 05 82 03 10 ...!...."?...... 30.2.16 00 0a 07 05 02 03 10 00 0a ......... 30.2.32 21.0 CTL 00 09 01 00 00 00 00 00 SET CONFIG 31.1.0 21.0 CTL 21 0a 00 00 00 00 00 00 SET IDLE 32.1.0 21.0 USTS 00 00 01 c0 canceled 32.2.0 21.0 CTL 81 06 00 22 00 00 7f 00 GET DESCRIPTOR 33.1.0 21.0 DI 05 01 09 06 a1 01 05 07 19 e0 29 e7 15 00 25 01 ..........)...%. 33.2.0 75 01 95 08 81 02 95 01 75 08 81 03 95 05 75 01 u.......u.....u. 33.2.16 05 08 19 01 29 05 91 02 95 01 75 03 91 03 95 06 ....).....u..... 33.2.32 75 08 15 00 25 ff 05 07 19 00 29 65 81 00 c0 u...%.....)e... 33.2.48 22.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 34.1.0 22.0 DO 12 01 01 01 00 00 00 10 21 ff 01 ff 00 00 00 00 ........!....... 34.2.0 00 01 .. 34.2.16 22.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 35.1.0 22.0 DO 09 02 22 00 01 01 00 80 32 ..".....2 35.2.0 22.0 CTL 80 06 00 02 00 00 22 00 GET DESCRIPTOR 36.1.0 22.0 DO 09 02 22 00 01 01 00 80 32 09 04 01 00 01 03 01 ..".....2....... 36.2.0 02 00 09 21 01 01 00 01 22 34 00 07 05 01 03 10 ...!...."4...... 36.2.16 00 1a .. 36.2.32 22.0 CTL 00 09 01 00 00 00 00 00 SET CONFIG 37.1.0 22.0 CTL 21 0a 00 00 01 00 00 00 SET IDLE 38.1.0 22.0 USTS 00 00 01 c0 canceled 38.2.0 22.0 CTL 81 06 00 22 01 00 74 00 GET DESCRIPTOR 39.1.0 22.0 DI 05 01 09 02 a1 01 09 01 a1 00 05 09 19 01 29 03 ..............). 39.2.0 15 00 25 01 95 03 75 01 81 02 95 01 75 05 81 03 ..%...u.....u... 39.2.16 05 01 09 30 09 31 09 38 15 81 25 7f 75 08 95 03 ...0.1.8..%.u... 39.2.32 81 06 c0 c0 .... 39.2.48 23.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 40.1.0 23.0 DO 12 01 01 01 00 00 00 10 21 ff 01 ff 00 00 00 00 ........!....... 40.2.0 00 01 .. 40.2.16 23.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 41.1.0 23.0 DO 09 02 22 00 01 01 00 80 32 ..".....2 41.2.0 23.0 CTL 80 06 00 02 00 00 22 00 GET DESCRIPTOR 42.1.0 23.0 DO 09 02 22 00 01 01 00 80 32 09 04 02 00 01 03 00 ..".....2....... 42.2.0 00 00 09 21 01 01 00 01 22 51 00 07 05 81 03 10 ...!...."Q...... 42.2.16 00 0a .. 42.2.32 23.0 CTL 00 09 01 00 00 00 00 00 SET CONFIG 43.1.0 23.0 CTL 21 0a 00 00 02 00 00 00 SET IDLE 44.1.0 23.0 USTS 00 00 01 c0 canceled 44.2.0 23.0 CTL 81 06 00 22 02 00 91 00 GET DESCRIPTOR 45.1.0 23.0 DI 05 0c 09 01 a1 01 85 02 15 00 25 01 75 01 95 0c ..........%.u... 45.2.0 09 e2 0a 8a 01 09 b7 0a 23 02 09 e9 09 ea 09 cd ........#....... 45.2.16 09 b6 09 b5 0a 92 01 0a 21 02 0a 2a 02 81 62 95 ........!..*..b. 45.2.32 04 81 03 c0 05 01 09 80 a1 01 85 03 75 02 95 01 ............u... 45.2.48 15 01 25 03 09 82 09 81 09 83 81 60 75 06 81 03 ..%........`u... 45.2.64 c0 . 45.2.80 21.2 DO 01 . 46.1.0 24 DO 00 01 .. 47.1.0
主要疑问:我在程序中,对PC读取配置描述符的响应是默认发送91个字节 也就是 20.0 CTL 80 06 00 02 00 00 5b 00 GET DESCRIPTOR 26.1.0 20.0 DI 09 02 5b 00 03 01 00 80 32 09 04 00 00 02 03 01 ..[.....2....... 26.2.0 01 00 09 21 01 01 00 01 22 3f 00 07 05 82 03 10 ...!...."?...... 26.2.16 00 0a 07 05 02 03 10 00 0a 09 04 01 00 01 03 01 ................ 26.2.32 02 00 09 21 01 01 00 01 22 34 00 07 05 01 03 10 ...!...."4...... 26.2.48 00 1a 09 04 02 00 01 03 00 00 00 09 21 01 01 00 ............!... 26.2.64 01 22 51 00 07 05 81 03 10 00 0a ."Q........ 26.2.80 但是后面的数据是怎么回事呢 21.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 28.1.0 21.0 DO 12 01 01 01 00 00 00 10 21 ff 01 ff 00 00 00 00 ........!....... 28.2.0 00 01 .. 28.2.16 怎么方向是DO呢? 对于 21.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 29.1.0 21.0 DO 09 02 29 00 01 01 00 80 32 ..).....2 29.2.0 21.0 CTL 80 06 00 02 00 00 29 00 GET DESCRIPTOR 30.1.0 21.0 DO 09 02 29 00 01 01 00 80 32 09 04 00 00 02 03 01 ..).....2....... 30.2.0 01 00 09 21 01 01 00 01 22 3f 00 07 05 82 03 10 ...!...."?...... 30.2.16 00 0a 07 05 02 03 10 00 0a ......... 30.2.32 像CTL 80 06 00 02 00 00 09 00 和 21.0 CTL 80 06 00 02 00 00 29 00 GET DESCRIPTOR 30.1.0 我程序发送数据的啊 怎么变成DO啦? 谁能说说看
另外 我的程序已经可以工作了,功能已经实现,不过对于配置过程有疑问,不知道是bushound出了问题还是windows对复合设备的配置过程有另外的方式 |