在读取完设备描述符之后,成功。然后配置地址,返回状态不是0x14而是0x28,即CMD_RD_USB_DATA,怎么会这样呢?
你直接参考CH375HST.ZIP\PUB\INTERLNK这个程序,set_addr()是设置地址的函数。你可以试着在发送完获取配置描述符之后,延时几MS之后,再发设置地址的命令。
相同的程序,在其他usb设备没有问题,但就是usb蓝牙适配器不行,我甚至延时200ms了
bushound截得pc以下初始化过程:
Device Phase Data Description Cmd.Phase.Ofs(rep) ------ ----- ------------------------ ---------------- ------------------ 16.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 1.1.0 16.0 DI 00 01 03 00 .... 1.2.0 16.0 CTL 23 01 11 00 01 00 00 00 CLEAR FEATURE 2.1.0 16.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 3.1.0(2) 16.0 DI 00 01 01 00 .... 3.2.0 16.0 CTL 23 01 10 00 01 00 00 00 CLEAR FEATURE 5.1.0 16.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 6.1.0 16.0 DI 00 01 00 00 .... 6.2.0 16.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 7.1.0 16.0 DI 03 03 00 00 .... 7.2.0 16.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 8.1.0(2) 16.0 DI 01 01 01 00 .... 8.2.0 16.0 CTL 23 01 10 00 01 00 00 00 CLEAR FEATURE 10.1.0 16.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 11.1.0(2) 16.0 DI 01 01 00 00 .... 11.2.0 16.0 CTL 23 03 04 00 01 00 00 00 SET FEATURE 13.1.0 16.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 14.1.0 16.0 DI 03 01 10 00 .... 14.2.0 16.0 CTL 23 01 14 00 01 00 00 00 CLEAR FEATURE 15.1.0 16.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 16.1.0(2) 16.0 DI 03 01 00 00 .... 16.2.0 16.0 CTL 23 03 04 00 01 00 00 00 SET FEATURE 18.1.0 16.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 19.1.0 16.0 DI 03 01 10 00 .... 19.2.0 16.0 CTL 23 01 14 00 01 00 00 00 CLEAR FEATURE 20.1.0 16.0 CTL 80 06 00 02 00 00 ff 00 GET DESCRIPTOR 21.1.0 16.0 DI 09 02 ba 00 03 01 00 c0 ........ 21.2.0 00 09 04 00 00 03 e0 01 ........ 21.2.8 01 00 07 05 81 03 10 00 ........ 21.2.16 01 07 05 02 02 40 00 01 .....@.. 21.2.24 16.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 22.1.0 16.0 DI 03 03 00 00 .... 22.2.0 30.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 23.1.0 30.0 DI 12 01 10 01 e0 01 01 10 ........ 23.2.0 31 11 01 10 73 03 01 02 1...s... 23.2.8 00 01 .. 23.2.16 30.0 CTL 80 06 00 02 00 00 09 02 GET DESCRIPTOR 24.1.0 30.0 DI 09 02 ba 00 03 01 00 c0 ........ 24.2.0 00 09 04 00 00 03 e0 01 ........ 24.2.8 01 00 07 05 81 03 10 00 ........ 24.2.16 01 07 05 02 02 40 00 01 .....@.. 24.2.24 30.0 CTL 00 09 01 00 00 00 00 00 SET CONFIG 25.1.0 30.0 CTL 01 0b 00 00 01 00 00 00 SET INTERFACE 26.1.0 30.0 CTL 20 00 00 00 00 00 03 00 SEND HCI 27.1.0 30.0 DO 03 0c 00 ... 27.2.0 30.1 DI 0e 04 01 03 0c 00 ...... 28.1.0 30.0 CTL 20 00 00 00 00 00 05 00 SEND HCI 29.1.0 30.0 DO 16 0c 02 00 b0 ..... 29.2.0 30.1 DI 0e 04 01 16 0c 00 ...... 30.1.0 30.0 CTL 20 00 00 00 00 00 05 00 SEND HCI 31.1.0 30.0 DO 18 0c 02 10 27 ....' 31.2.0 30.1 DI 0e 04 01 18 0c 00 ...... 32.1.0 30.0 CTL 20 00 00 00 00 00 03 00 SEND HCI 33.1.0 30.0 DO 15 0c 00 ... 33.2.0 30.1 DI 0e 06 01 15 0c 00 00 b0 ........ 34.1.0 30.0 CTL 20 00 00 00 00 00 03 00 SEND HCI 35.1.0 30.0 DO 05 10 00 ... 35.2.0 30.1 DI 0e 0b 01 05 10 00 a6 02 ........ 36.1.0 30 08 00 0a 00 0.... 36.1.8 30.0 CTL 20 00 00 00 00 00 04 00 SEND HCI 37.1.0 30.0 DO 31 0c 01 00 1... 37.2.0 30.1 DI 0e 04 01 31 0c 00 ...1.. 38.1.0 30.0 CTL 20 00 00 00 00 00 0a 00 SEND HCI 39.1.0 30.0 DO 33 0c 07 80 02 ff a0 00 3....... 39.2.0 14 00 .. 39.2.8 30.1 DI 0e 04 01 33 0c 00 ...3.. 40.1.0 30.0 CTL 20 00 00 00 00 00 03 00 SEND HCI 41.1.0 30.0 DO 03 10 00 ... 41.2.0 30.1 DI 0e 0c 01 03 10 00 bf fe ........ 42.1.0 8d 78 08 18 00 00 .x.... 42.1.8 30.0 CTL 20 00 00 00 00 00 04 00 SEND HCI 43.1.0 30.0 DO 0a 0c 01 00 .... 43.2.0 30.1 DI 0e 04 01 0a 0c 00 ...... 44.1.0 30.0 CTL 20 00 00 00 00 00 04 00 SEND HCI 45.1.0 30.0 DO 1a 0c 01 01 .... 45.2.0 30.1 DI 0e 04 01 1a 0c 00 ...... 46.1.0 30.0 CTL 20 00 00 00 00 00 03 00 SEND HCI 47.1.0 30.0 DO 14 0c 00 ... 47.2.0 30.1 DI 0e fc 01 14 0c 00 49 53 ......IS 48.1.0 53 43 42 54 41 00 00 00 SCBTA... 48.1.8 00 00 00 00 00 00 00 00 ........ 48.1.16 00 00 00 00 00 00 00 00 ........ 48.1.24 30.1 DI 00 00 00 00 00 00 00 00 ........ 49.1.0 00 00 00 00 00 00 00 00 ........ 49.1.8 00 00 00 00 00 00 00 00 ........ 49.1.16 00 00 00 00 00 00 00 00 ........ 49.1.24 30.0 CTL 20 00 00 00 00 00 03 00 SEND HCI 50.1.0 30.0 DO 09 10 00 ... 50.2.0 30.1 DI 0e 0a 01 09 10 00 79 56 ......yV 51.1.0 20 67 11 00 g.. 51.1.8 30.0 CTL 20 00 00 00 00 00 03 00 SEND HCI 52.1.0 30.0 DO 23 0c 00 #.. 52.2.0 30.1 DI 0e 07 01 23 0c 00 00 00 ...#.... 53.1.0 00 . 53.1.8 30.0 CTL 20 00 00 00 00 00 06 00 SEND HCI 54.1.0 30.0 DO 24 0c 03 00 00 00 $..... 54.2.0 30.1 DI 0e 04 01 24 0c 0