我有一个设备通过USB进行通信,电脑上位机和设备通信的过程通过Bus Hound 捕捉如下:
Device - Device ID (followed by the endpoint for USB devices)
(3) 英特尔(R) USB 3.0 可扩展主机控制器
(20) USB 输入设备
(21) HID-compliant device
Length - Total transfer length
Phase - Phase Type
CTL USB control transfer
IN Data in transfer
OUT Data out transfer
USTS USB status
Data - Hex dump of the data transferred
Descr - Description of the phase
Cmd... - Position in the captured data
Device Length Phase Data Description Cmd.Phase.Ofs(rep)
------ -------- ----- -------------------- ------------------------------USB设备驱动枚举识别-------------------------------------------------- -------------------------------- ------------------
20.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 1.1.0
20.0 18 IN 12 01 00 00 00 00 00 20 89 0f 16 01 00 00 00 00 00 00 ....... .......... 1.2.0
20.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 2.1.0
20.0 9 IN 09 02 29 00 01 01 00 80 fa ..)...... 2.2.0
20.0 CTL 80 06 00 02 00 00 29 00 GET DESCRIPTOR 3.1.0
20.0 41 IN 09 02 29 00 01 01 00 80 fa 09 04 00 00 02 03 00 00 00 09 21 00 01 21 01 22 1d 00 07 05 81 03 08 ..)................!..!."....... 3.2.0
(03端点描述符中断传输)
20.0 CTL 00 09 01 00 00 00 00 00 SET CONFIG 4.1.0
20.0 CTL 21 0a 00 00 00 00 00 00 SET IDLE 5.1.0
20.0 USTS c0000004 stall pid 5.2.0
20.0 CTL 81 06 00 22 00 00 5d 00 GET DESCRIPTOR 6.1.0
20.0 29 IN 06 00 ff 09 01 a1 01 09 01 95 08 75 08 15 00 26 ff 00 81 02 09 02 95 5f 75 08 91 02 c0 ...........u...&......._u.... 6.2.0
20 0 IN
-------------------------------------------------------------------------------USB上位机连接--------------------------------------------------------------------------------------------------------
7.1.0(3323)
20.0 CTL 80 06 00 03 09 04 80 00 GET DESCRIPTOR 3330.1.0
20.0 4 IN 04 03 09 04 .... 3330.2.0
20.0 CTL 80 06 00 03 09 04 80 00 GET DESCRIPTOR 3331.1.0
20 0 IN 3332.1.0
20.0 4 IN 04 03 09 04 .... 3331.2.0
20.0 CTL 80 06 00 03 09 04 80 00 GET DESCRIPTOR 3333.1.0
20.0 4 IN 04 03 09 04 .... 3333.2.0
20 0 IN 3334.1.0
20.2 95 OUT ab 86 01 01 01 01 01 01 31 68 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........1h...................... 3335.1.0
21 96 OUT 00 ab 86 01 01 01 01 01 01 31 68 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .........1h..................... 3336.1.0
20 0 IN 3337.1.0
20.1 8 IN ab 86 01 01 01 01 01 01 ........ 3338.1.0
21 9 IN 00 ab 86 01 01 01 01 01 01 ......... 3339.1.0
20 0 IN 3340.1.0(8488)
-----------------------------------------------------------------------------USB上位机发送数据------------------------------------------------------------------------------------------------------
20.2 95 OUT ab c1 01 00 01 07 01 00 31 32 33 34 95 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........1234.................... 11828.1.0
21 96 OUT 00 ab c1 01 00 01 07 01 00 31 32 33 34 95 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .........1234................... 11829.1.0
20 0 IN 11830.1.0(6008)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
我用STM32F4Discover板子作为主机,在STM32F4识别鼠标程序的基础上修改,这个设备可以枚举成功,枚举成功后,要先输出数据给从机,连接设备,这个数据该怎么发出去?
发数据后如何接受返回的数据。高手路过请指导。
|