USB系列之-UVC+UAC扬声器+UAC麦克风+CDC实例分享

原创 嵌入式Lee 2024-04-21 08:01

一. 前言

前面我们分享了:

UAC的扬声器设备,https://mp.weixin.qq.com/s/_oHU-1ied_LMcyO1PtLv4g

UAC的麦克风设备,https://mp.weixin.qq.com/s/M3LR3POC14BrgYavhH0qtg

UAC的扬声器+UAC麦克风的设备,https://mp.weixin.qq.com/s/bLSLwPjl5cC_8X-YxZo89Q

UVC+UAC扬声器+UAC麦克风设备,https://mp.weixin.qq.com/s/_5quPTyLQ-_T0D7MfMTqCw

而一般在开发和维护过程中还需要和设备交互的链路,通常做法是使用UART,但是这样需要多预留接口不是很方便,我们可以使用CDC虚拟出一个串口来用于和设备通讯进行管理。这样ALL IN USB非常方便。所以本文继续在UVC+UAC(扬声器+麦克风)的复合设备的基础上再添加CDC

重点在该复合设备的描述符拓扑和描述符的内容,具体每个设备的枚举类相关请求等可以参考前面的文章和规格书。

.描述符拓扑

我们使用IAD可以方便的实现复合设备,前面已经实现了UVCUAC以及其复合设备,现在只需要再添加一个CDC,即添加一个IAD即可。

IAD可以参考文章https://mp.weixin.qq.com/s/qPdHOjLlZRoAKCdj1_8ZGA

配置描述符拓扑如下,分为3IAD

UVC部分

UAC部分

CDC部分

UVC一共两个接口

控制接口0,一个输入终端,一个处理单元,一个输出终端。

0带宽流接口1alt 0, 实现了MJPEG一种格式, 5种分辨率。

0带宽流接口1alt 1,实现一个IN端点0x81用于发送数据。

UAC一共3个接口,接口2是控制接口,接口3是扬声器流,接口4是麦克风流。

接口3alt00带宽接口,设置接口选择该alt时关闭扬声器流,alt1是数据流接口,设置接口选择该alt时启动扬声器流,该接口下有一个OUT端点用于接收数据。

接口4alt00带宽接口,设置接口选择该alt时关闭麦克风流,alt1是数据流接口,设置接口选择该alt时启动麦克风流,该接口下有一个IN端点用于发送数据。

控制接口中包括

扬声器的:输入终端1,特征单元2和输出终端3。流接口3alt 1绑定到输入终端,

而输入终端对应的是OUT端点0x02

麦克风的:输入终端4,特征单元5和输出终端6。流接口4alt 1绑定到输出终端,

而输出终端对应的是IN端点0x82,注意这里在特征单元5和输出终端6之间插入了选择单元7.

CDC控制接口5

数据接口6,一个IN端点,一个OUT端点。

.描述符实例

3.1描述符内容

设备描述符和配置描述符如下,字符串描述符就略去了,描述符后有详细的注释和注意说明,不再赘述。

static const uint8_t dev_desc[] = {    0x12,        /* bLength 本描述符长度,固定为0x12 */    0x01,        /* bDescriptorType 描述符类型DEVICE=1, 见Table 9-5. Descriptor Types */    0x00,0x02,   /* bcdUSB USB规格书发布编号,BCD,小端 */    /* bDeviceClass-bDeviceSubClass-DeviceProtocol决定具体设备类型 见https://www.usb.org/defined-class-codes     * 这里EF-02-01表示IAD设备     */    0xEF,        /* bDeviceClass 设备类类型  */    0x02,        /* bDeviceSubClass 设备子类 */    0x01,        /* bDeviceProtocol 设备协议 */    0x40,        /* bMaxPacketSize0 控制端点最大包大小 */    0x4A,0x4C,   /* idVendor 厂商ID VID,小端*/    0x55,0x4C,   /* idProduct 产品ID PID,小端*/    0x00,0x01,   /* bcdDevice 设备发布号,BCD,小端*/    0x01,        /* iManufacturer 制造商字符串描述符索引 */      0x02,        /* iProduct 产品字符串描述符索引 */    0x00,        /* iSerialNumber 设备序列号字符串描述符索引 0则不使用 */    0x01,        /* bNumConfigurations 配置个数 */};
static const uint8_t cfg_desc[] = {    /* 配置描述符见Table 9-10. Standard Configuration Descriptor */    0x09,  /* bLength 本描述符长度,固定为9 */    0x02,  /* bDescriptorType 描述符类型CONFIGURATION =0x02, 见Table 9-5. Descriptor Types P251 */    0x3A,  /* wTotalLength 本配置符所有内容长度,小端 */    0x02,    0x07,  /* bNumInterfaces 本配置的接口数 一个控制一个流 */    0x01,  /* bConfigurationValue 设置配置请求,选择该配置的对应的设置值 */    0x00,  /* iConfiguration 本配置对应的字符串描述符,配置为0则没有     */    0x80,  /* bmAttributes 配置特征 D7固定为1 D6:Self-powered D5:Remote Wakeup*/    0xC8,  /* bMaxPower 最大消耗电流,单位2mA */
    /********************************************************     *           以下是UVC部分     *******************************************************/    /**     * IAD描述符     * 见UVC 1.5 Class specification.pdf 3.6 Interface Association Descriptor P60    */    0x08,                /* bLength 本描述符长度,固定为8 */    0x0B,                /* bDescriptorType 描述符类型 INTERFACE_ASSOCIATION=0x0B 参考InterfaceAssociationDescriptor_ecn P3 */    UVC_ITF_VC,          /* bFirstInterface 本IAD下第一个接口 */    0x02,                /* bInterfaceCount 本IAD下接口数,默认一个控制接口一个流接口 */    0x0E,                /* bFunctionClass 功能类 见UVC 1.5 Class specification.pdf Table A- 1 Video Interface Class Code P171 CC_VIDEO=0x0E */    0x03,                /* bFunctionSubClass 功能子类 见UVC 1.5 Class specification.pdf Table A- 2 Video Interface Subclass Codes P171 SC_VIDEO_INTERFACE_COLLECTION=0x03  */    0x00,                /* bFunctionProtocol 功能协议号 见UVC 1.5 Class specification.pdf Table A- 3 Video Interface Protocol Codes P171 PC_PROTOCOL_UNDEFINED=0x00 */    0x05,                /* iFunction 对应字符串索引                                */
        /* 控制接口描述符 见UVC 1.5 Class specification.pdf 3.7 VideoControl Interface Descriptors P61          * Table 3-2 Standard VC Interface Descriptor        */        0x09,                      /* bLength  本描述符长度,固定为9               */        0x04,                      /* bDescriptorType 描述符类型  见usb_20 P251 Table 9-5. Descriptor Types  INTERFACE=4  */        UVC_ITF_VC,                /* bInterfaceNumber  接口号,从0开始            */        0x00,                      /* bAlternateSetting alt接口号,从0开始         */        0x00,                      /* bNumEndpoints 本接口下端点数                */        0x0E,                      /* bInterfaceClass 接口类,见UVC 1.5 Class specification.pdf Table A- 1 Video Interface Class Code P171 CC_VIDEO=0x0E        */        0x01,                      /* bInterfaceSubClass接口子类 见UVC 1.5 Class specification.pdf Table A- 2 Video Interface Subclass Codes P171 SC_VIDEOCONTROL=0x01   */        0x00,                      /* bInterfaceProtocol 接口协议号,见UVC 1.5 Class specification.pdf Table A- 3 Video Interface Protocol Codes P171 PC_PROTOCOL_UNDEFINED=0x00 */        0x05,                      /* iInterface 本接口字符串描述符索引            */
                /* 见UVC 1.5 Class specification.pdf 3.7.2 Class-Specific VC Interface Descriptor P62                  * Table 3-3 Class-specific VC Interface Header Descriptor                 */                0x0D,                   /* bLength  本描述符长度 12+n */                0x24,                   /* bDescriptorType 描述符类型 见UVC 1.5 Class specification.pdf P171 Table A- 4 Video Class-Specific Descriptor Types CS_INTERFACE=0x24 */                0x01,                   /* bDescriptorSubType 描述符子类型 见UVC 1.5 Class specification.pdf P172 Table A- 5 Video Class-Specific VC Interface Descriptor Subtypes VC_HEADER=0x01 */                0x00, 0x01,             /* bcdUVC UVC版本,压缩BCD,小端 */                0x50, 0x00,             /* wTotalLength 本描述符加后面的所有Input/Output Terminal和Unit的总长    */                UVC_MAKE_DWORD(UVC_CLOCKFRQ), /* dwClockFrequency 设备时钟频率,单位Hz,小端4字节 */                1,                      /* bInCollection 本VideoControl接口包含的VideoStreaming interfaces接口数 */                UVC_ITF_VS,             /* baInterfaceNr(1) 第一个VideoStreaming interface接口号 */
                        /*  见UVC 1.5 Class specification.pdf P64 3.7.2.1 Input Terminal Descriptor                           *  Table 3-4 Input Terminal Descriptor                         */                        0x12,               /* bLength  8+x */                        0x24,               /* bDescriptorType 描述符类型 见UVC 1.5 Class specification.pdf P171 Table A- 4 Video Class-Specific Descriptor Types CS_INTERFACE=0x24 */                        0x02,               /* bDescriptorSubType 描述符子类型 见UVC 1.5 Class specification.pdf P172 Table A- 5 Video Class-Specific VC Interface Descriptor Subtypes VC_INPUT_TERMINAL=0x02      */                        UVC_TID_IN,         /* bTerminalID (1) 终端ID,非0       */                        UVC_MAKE_WORD(0x0201),       /* wTerminalType  见UVC 1.5 Class specification.pdf P177 Table B- 2 Input Terminal Types (ITT_CAMERA=0x0201)  */                        0x00,                        /* bAssocTerminal(Not  associated with an Output Terminal) */                        0x00,                        /* iTerminal 终端的字符串描述符索引,  (No String Descriptor) */                        UVC_MAKE_WORD(0x0000),       /* wObjectiveFocalLengthMin */                        UVC_MAKE_WORD(0x0000),       /* wObjectiveFocalLengthMax */                        UVC_MAKE_WORD(0x0000),       /* wOcularFocalLength */                        0x03,                        /* bControlSize (3 bytes) */                        /*  bmControls                        D0: Scanning Mode                        D1: Auto-Exposure Mode                        D2: Auto-Exposure Priority                        D3: Exposure Time (Absolute)                        D4: Exposure Time (Relative)                        D5: Focus (Absolute)                        D6 : Focus (Relative)                        D7: Iris (Absolute)                        D8 : Iris (Relative)                        D9: Zoom (Absolute)                        D10: Zoom (Relative)                        D11: PanTilt (Absolute)                        D12: PanTilt (Relative)                        D13: Roll (Absolute)                        D14: Roll (Relative)                        D15: Reserved                        D16: Reserved                        D17: Focus, Auto                        D18: Privacy                        D19: Focus, Simple                        D20: Window                        D21: Region of Interest                        D22 – D23: Reserved, set to zero                        */                        0x0A,                        0x00,                        0x00,
                        /* 见UVC 1.5 Class specification.pdf P69 3.7.2.5 Processing Unit Descriptor                          * Table 3-8 Processing Unit Descriptor                         */                        0x0B,                        /*  bLength  (11 bytes) */                        0x24,                        /*  bDescriptorType 描述符类型 见UVC 1.5 Class specification.pdf P171 Table A- 4 Video Class-Specific Descriptor Types CS_INTERFACE=0x24 */                        0x05,                        /*  bDescriptorSubType 描述符子类型 见UVC 1.5 Class specification.pdf P172 Table A- 5 Video Class-Specific VC Interface Descriptor Subtypes VC_PROCESSING_UNIT=0x05 */                        UVC_TID_PU,                  /*  bUnitID (1)   */                        UVC_TID_IN,                  /*  bSourceID (2) */                        UVC_MAKE_WORD(0x0000),       /*  wMaxMultiplier */                        0x02,                        /*  bControlSize (3 bytes) */                        /*                        bmControls                        D0: Brightness                        D1: Contrast                        D2: Hue                        D3: Saturation                        D4: Sharpness                        D5: Gamma                        D6: White Balance Temperature                        D7: White Balance Component                        D8: Backlight Compensation                        D9: Gain                        D10: Power Line Frequency                        D11: Hue, Auto                        D12: White Balance Temperature, Auto                        D13: White Balance Component, Auto                        D14: Digital Multiplier                        D15: Digital Multiplier Limit                        D16: Analog Video Standard                        D17: Analog Video Lock Status                        D18: Contrast, Auto                        D19 – D23: Reserved. Set to zero                        */                        0x7B,                        0x07,                        0x00,                  /* iProcessing  Index of a string descriptor */                        /*  bmVideoStandards                        D0: None                        D1: NTSC – 525/60                        D2: PAL – 625/50                        D3: SECAM – 625/50                        D4: NTSC – 625/50                        D5: PAL – 525/60                        */                        //0x00,
                        /* 见UVC 1.5 Class specification.pdf P73 Table 3-10 Extension Unit Descriptor                          *                         */                        0x1D, /* bLength */                        0x24, /* bDescriptorType 描述符类型 见UVC 1.5 Class specification.pdf P171 Table A- 4 Video Class-Specific Descriptor Types CS_INTERFACE=0x24          */                        0x06, /* bDescriptorSubType 描述符子类型 见UVC 1.5 Class specification.pdf P172 Table A- 5 Video Class-Specific VC Interface Descriptor Subtypes VC_EXTENSION_UNIT=0x06  */                        0x03, /* bUnitID  应该是UVC_TID_EXT=4 这里可能之前还有一个扩展单元3删掉了 */                        0x70,0x33,0xF0,0x28, /*guidExtensionCode:{28F03370-6311-4A2E-BA2C-6890EB334016} */                        0x11,0x63,                        0x2E,0x4A,                        0xBA,0x2C,                        0x68,0x90,0xEB,0x33,0x40,0x16,                        0x08,        /* bNumControls   */                        0x01,        /* bNrInPins */                        UVC_TID_PU,        /* baSourceID[1]  */                        0x04,        /* bControlSize   */                        /* bmControls                          D0~D31: 1  yes -  Vendor-Specific (Optional)                        */                        0xFF,0xFF,0xFF,0xFF,                        0x00,        /* iExtension */
                        /* 见UVC 1.5 Class specification.pdf 3.7.2.2 Output Terminal Descriptor P66 */                        0x09,               /* bLength */                        0x24,               /* bDescriptorType 描述符类型 见UVC 1.5 Class specification.pdf P171 Table A- 4 Video Class-Specific Descriptor Types CS_INTERFACE=0x24          */                        0x03,               /* bDescriptorSubType 描述符子类型 见UVC 1.5 Class specification.pdf P172 Table A- 5 Video Class-Specific VC Interface Descriptor Subtypes VC_OUTPUT_TERMINAL=0x03  */                        UVC_TID_OUT,        /* bTerminalID 终端ID. 9.2.1 Input Header Descriptor的bTerminalLink对应 */                        UVC_MAKE_WORD(0x0101),     /* wTerminalType  见UVC 1.5 Class specification.pdf P177 Table B- 1 USB Terminal Types (TT_STREAMING=0x0101)   */                        0,                         /* bAssocTerminal 关联Input Terminal */                        UVC_TID_EXT,               /* bSourceID 本终端连接的Unit or Terminal的ID */                        0x00,                      /* iTerminal 描述终端的字符串描述符索*/
        /* Class-Specific VS Interface Descriptors alternate setting 0          * 见UVC 1.5 Class specification.pdf P76 Table 3-13 Standard VS Interface Descriptor         */        0x09,                   /* bLength   接口描述符长固定9字节            */        0x04,                   /* bDescriptorType  bDescriptorType   见usb_20 P251 Table 9-5. Descriptor Types  INTERFACE=4        */        UVC_ITF_VS,             /* bInterfaceNumber  接口索引           */        0x00,                   /* bAlternateSetting alt接口设置索引    */        0x00,                   /* bNumEndpoints 本接口使用的端点个数(不含端点0) */        0x0E,                   /* bInterfaceClass 见UVC 1.5 Class specification.pdf P171 Table A- 1 Video Interface Class Code  CC_VIDEO=0x0E */        0x02,                   /* bInterfaceSubClass 见UVC 1.5 Class specification.pdf P171 Table A- 2 Video Interface Subclass Codes SC_VIDEOSTREAMING=0x02        */        0x00,                   /* bInterfaceProtocol 见UVC 1.5 Class specification.pdf P171 Table A- 3 Video Interface Protocol Codes PC_PROTOCOL_UNDEFINED=0x00 */        0x00,                   /* iInterface 字符串描述符索引 0:            */
                /* 3.9.2 Class-Specific VS Interface Descriptors                   3.9.2.1 Input Header Descriptor                    见UVC 1.5 Class specification.pdf P76 Table 3-14 Class-specific VS Interface Input Header Descriptor*/                0x0F,            /* bLength 13+(p*n)                     */                0x24,            /* bDescriptorType 描述符类型 见UVC 1.5 Class specification.pdf P171 Table A- 4 Video Class-Specific Descriptor Types CS_INTERFACE=0x24        */                0x01,            /* bDescriptorSubtype 见UVC 1.5 Class specification.pdf P172 Table A- 6 Video Class-Specific VS Interface Descriptor Subtypes VS_INPUT_HEADER=0x01   */                0x01,            /* bNumFormats 本接口对应的格式描述符个数 */                0xB6,0x00,       /* wTotalLength 本描述符加上后面格式描述帧描述符的长*/                UVC_IN_ED,       /* bEndpointAddress videa data对应的端D7: Direction 1 = IN endpoint D3..0: The endpoint number*/                0x00,            /* bmInfo D0: Dynamic Format Change supported */                UVC_TID_OUT,     /* bTerminalLink 本接口的video端点连接的输出终端的ID */                0x00,            /* bStillCaptureMethod Method of still image capture */                0x00,            /* bTriggerSupport */                0x00,            /* bTriggerUsage */                0x02,            /* bControlSize bmaControls区域的大小 每个格式对应1字节,4种格式 */                /*                For bits D3..0, a bit set to 1 indicates that                the named field is supported by the Video                Probe and Commit Control when                bFormatIndex is 1:                D0: wKeyFrameRate                D1: wPFrameRate                D2: wCompQuality                D3: wCompWindowSize                For bits D5..4, a bit set to 1 indicates that                the named control is supported by the                device when bFormatIndex is 1:                D4: Generate Key Frame                D5: Update Frame Segment                D6..(n*8-1): Reserved, set to zero                */                0x00,            /* bmaControls(1) */                0x00,            /* bmaControls(2) */
                        /**************************************                         *    MJPEG格式部分                         *************************************/                        /* 见 MJPEG USB_Video_Payload_MJPEG_1.5.pdf P12 3.1.1 MJPEG Video Format Descriptor */                        0x0B,           /* bLength 描述符长固定x0B  */                        0x24,           /* bDescriptorType 描述符类型 见UVC 1.5 Class specification.pdf P171 Table A- 4 Video Class-Specific Descriptor Types CS_INTERFACE=0x24  */                        0x06,           /* bDescriptorSubtype 见UVC 1.5 Class specification.pdf P172 Table A- 6 Video Class-Specific VS Interface Descriptor Subtypes VS_FORMAT_MJPEG=0x06 */                        0x01,           /* bFormatIndex 格式描述索引  */                        0x05,           /* bNumFrameDescriptors 与此格式描述符对应的帧描述符个数 */                        0x00,           /* bmFlags D0: FixedSizeSamples. 1 = Yes */                        0x01,           /* bDefaultFrameIndex 此流的默认帧索引 */                        0x00,           /* bAspectRatioX 纵横比x*/                        0x00,           /* bAspectRatioY 纵横比y*/                        /*                        Specifies interlace information. If the                        scanning mode control in the Camera                        Terminal is supported for this stream,                        this field should reflect the field format                        used in interlaced mode.                        (Top field in PAL is field 1, top field in                        NTSC is field 2.):                        D0: Interlaced stream or variable. 1 =                        Yes                        D1: Fields per frame. 0= 2 fields, 1 = 1                        field                        D2: Field 1 first. 1 = Yes                        D3: Reserved                        D5..4: Field pattern                        00 = Field 1 only                        01 = Field 2 only                        10 = Regular pattern of fields 1 and 2                        11 = Random pattern of fields 1 and 2                        D7..6: Reserved. Do not use.                        */                        0x00,           /* bmInterlaceFlags */                        0x00,           /* bCopyProtect 是否限制重复的视频流 */
                        /* 见 MJPEG USB_Video_Payload_MJPEG_1.5.pdf P13 Table 3-2 Motion-JPEG Video Frame Descriptor */                        0x1E,                   /* bLength   描述符长bFrameIntervalType=08,bFrameIntervalType>06+(4*n) */                        0x24,                   /* bDescriptorType 描述符类型 见UVC 1.5 Class specification.pdf P171 Table A- 4 Video Class-Specific Descriptor Types CS_INTERFACE=0x24 */                        0x07,                   /* bDescriptorSubtype 见UVC 1.5 Class specification.pdf P172 Table A- 6 Video Class-Specific VS Interface Descriptor Subtypes VS_FRAME_MJPEG=0x07 */                        0x01,                   /* bFrameIndex  帧描述符索引 */                        0x00,                   /* bmCapabilities D0: Still image supported(Image Capture Method 1) D1: Fixed frame-rate*/
                        UVC_MAKE_WORD(UVC_MJPEG_WIDTH_MAX1),    /* wWidth  */                          UVC_MAKE_WORD(UVC_MJPEG_HEIGHT_MAX1),   /* wHeight  */                        UVC_MAKE_DWORD(UVC_MJPEG_MIN_BIT_RATE1),  /* dwMinBitRate 指定默认压缩质量下和最长的帧间隔时对应的传输最小比特率bps */                        UVC_MAKE_DWORD(UVC_MJPEG_MAX_BIT_RATE1),      /* dwMaxBitRate 指定默认压缩质量下和最短的帧间隔时对应的传输最大比特率bps */                        UVC_MAKE_DWORD(UVC_MJPEG_MAX_FRAME_SIZE1),   /* dwMaxVideoFrameBufferSize 帧压缩缓冲大小 */                        UVC_MAKE_DWORD(UVC_MJPEG_FRAME_DEFINTERVEL), /* dwDefaultFrameInterval 默认帧间隔 */                        0x01,                                        /* bFrameIntervalType 帧间隔配置方0:连续帧间1..255:离散帧间隔配置个*/                        UVC_MAKE_DWORD(UVC_MJPEG_FRAME_DEFINTERVEL), /* 帧间隔  单位 100ns */
                        /* 见 MJPEG USB_Video_Payload_MJPEG_1.5.pdf P13 Table 3-2 Motion-JPEG Video Frame Descriptor */                        0x1E,                   /* bLength   描述符长bFrameIntervalType=08,bFrameIntervalType>06+(4*n) */                        0x24,                   /* bDescriptorType 描述符类型 见UVC 1.5 Class specification.pdf P171 Table A- 4 Video Class-Specific Descriptor Types CS_INTERFACE=0x24 */                        0x07,                   /* bDescriptorSubtype 见UVC 1.5 Class specification.pdf P172 Table A- 6 Video Class-Specific VS Interface Descriptor Subtypes VS_FRAME_MJPEG=0x07 */                        0x02,                   /* bFrameIndex  帧描述符索引 */                        0x00,                   /* bmCapabilities D0: Still image supported(Image Capture Method 1) D1: Fixed frame-rate*/                        UVC_MAKE_WORD(UVC_MJPEG_WIDTH_MAX2),    /* wWidth  */                         UVC_MAKE_WORD(UVC_MJPEG_HEIGHT_MAX2),    /* wHeight  */                        UVC_MAKE_DWORD(UVC_MJPEG_MIN_BIT_RATE2),  /* dwMinBitRate 指定默认压缩质量下和最长的帧间隔时对应的传输最小比特率bps */                        UVC_MAKE_DWORD(UVC_MJPEG_MAX_BIT_RATE2),      /* dwMaxBitRate 指定默认压缩质量下和最短的帧间隔时对应的传输最大比特率bps */                        UVC_MAKE_DWORD(UVC_MJPEG_MAX_FRAME_SIZE2),   /* dwMaxVideoFrameBufferSize 帧压缩缓冲大小 */                        UVC_MAKE_DWORD(UVC_MJPEG_FRAME_DEFINTERVEL), /* dwDefaultFrameInterval 默认帧间隔 */                        0x01,                                        /* bFrameIntervalType 帧间隔配置方0:连续帧间1..255:离散帧间隔配置个*/                        UVC_MAKE_DWORD(UVC_MJPEG_FRAME_DEFINTERVEL), /* 帧间隔  单位 100ns */
                        /* 见 MJPEG USB_Video_Payload_MJPEG_1.5.pdf P13 Table 3-2 Motion-JPEG Video Frame Descriptor */                        0x1E,                   /* bLength   描述符长bFrameIntervalType=08,bFrameIntervalType>06+(4*n) */                        0x24,                   /* bDescriptorType 描述符类型 见UVC 1.5 Class specification.pdf P171 Table A- 4 Video Class-Specific Descriptor Types CS_INTERFACE=0x24 */                        0x07,                   /* bDescriptorSubtype 见UVC 1.5 Class specification.pdf P172 Table A- 6 Video Class-Specific VS Interface Descriptor Subtypes VS_FRAME_MJPEG=0x07 */                        0x03,                   /* bFrameIndex  帧描述符索引 */                        0x00,                   /* bmCapabilities D0: Still image supported(Image Capture Method 1) D1: Fixed frame-rate*/                        UVC_MAKE_WORD(UVC_MJPEG_WIDTH_MAX3),    /* wWidth  */                         UVC_MAKE_WORD(UVC_MJPEG_HEIGHT_MAX3),   /* wHeight  */                        UVC_MAKE_DWORD(UVC_MJPEG_MIN_BIT_RATE3),  /* dwMinBitRate 指定默认压缩质量下和最长的帧间隔时对应的传输最小比特率bps */                        UVC_MAKE_DWORD(UVC_MJPEG_MAX_BIT_RATE3),      /* dwMaxBitRate 指定默认压缩质量下和最短的帧间隔时对应的传输最大比特率bps */                        UVC_MAKE_DWORD(UVC_MJPEG_MAX_FRAME_SIZE3),   /* dwMaxVideoFrameBufferSize 帧压缩缓冲大小 */                        UVC_MAKE_DWORD(UVC_MJPEG_FRAME_DEFINTERVEL), /* dwDefaultFrameInterval 默认帧间隔 */                        0x01,                                        /* bFrameIntervalType 帧间隔配置方0:连续帧间1..255:离散帧间隔配置个*/                        UVC_MAKE_DWORD(UVC_MJPEG_FRAME_DEFINTERVEL), /* 帧间隔  单位 100ns */
                        /* 见 MJPEG USB_Video_Payload_MJPEG_1.5.pdf P13 Table 3-2 Motion-JPEG Video Frame Descriptor */                        0x1E,                   /* bLength   描述符长bFrameIntervalType=08,bFrameIntervalType>06+(4*n) */                        0x24,                   /* bDescriptorType 描述符类型 见UVC 1.5 Class specification.pdf P171 Table A- 4 Video Class-Specific Descriptor Types CS_INTERFACE=0x24 */                        0x07,                   /* bDescriptorSubtype 见UVC 1.5 Class specification.pdf P172 Table A- 6 Video Class-Specific VS Interface Descriptor Subtypes VS_FRAME_MJPEG=0x07 */                        0x04,                   /* bFrameIndex  帧描述符索引 */                        0x00,                   /* bmCapabilities D0: Still image supported(Image Capture Method 1) D1: Fixed frame-rate*/                        UVC_MAKE_WORD(UVC_MJPEG_WIDTH_MAX4),    /* wWidth  */                         UVC_MAKE_WORD(UVC_MJPEG_HEIGHT_MAX4),   /* wHeight  */                        UVC_MAKE_DWORD(UVC_MJPEG_MIN_BIT_RATE4),  /* dwMinBitRate 指定默认压缩质量下和最长的帧间隔时对应的传输最小比特率bps */                        UVC_MAKE_DWORD(UVC_MJPEG_MAX_BIT_RATE4),      /* dwMaxBitRate 指定默认压缩质量下和最短的帧间隔时对应的传输最大比特率bps */                        UVC_MAKE_DWORD(UVC_MJPEG_MAX_FRAME_SIZE4),   /* dwMaxVideoFrameBufferSize 帧压缩缓冲大小 */                        UVC_MAKE_DWORD(UVC_MJPEG_FRAME_DEFINTERVEL), /* dwDefaultFrameInterval 默认帧间隔 */                        0x01,                                        /* bFrameIntervalType 帧间隔配置方0:连续帧间1..255:离散帧间隔配置个*/                        UVC_MAKE_DWORD(UVC_MJPEG_FRAME_DEFINTERVEL), /* 帧间隔  单位 100ns */
                        /* 见 MJPEG USB_Video_Payload_MJPEG_1.5.pdf P13 Table 3-2 Motion-JPEG Video Frame Descriptor */                        0x1E,                   /* bLength   描述符长bFrameIntervalType=08,bFrameIntervalType>06+(4*n) */                        0x24,                   /* bDescriptorType 描述符类型 见UVC 1.5 Class specification.pdf P171 Table A- 4 Video Class-Specific Descriptor Types CS_INTERFACE=0x24 */                        0x07,                   /* bDescriptorSubtype 见UVC 1.5 Class specification.pdf P172 Table A- 6 Video Class-Specific VS Interface Descriptor Subtypes VS_FRAME_MJPEG=0x07 */                        0x05,                   /* bFrameIndex  帧描述符索引 */                        0x00,                   /* bmCapabilities D0: Still image supported(Image Capture Method 1) D1: Fixed frame-rate*/                        UVC_MAKE_WORD(UVC_MJPEG_WIDTH_MAX5),    /* wWidth  */                         UVC_MAKE_WORD(UVC_MJPEG_HEIGHT_MAX5),   /* wHeight  */                        UVC_MAKE_DWORD(UVC_MJPEG_MIN_BIT_RATE5),  /* dwMinBitRate 指定默认压缩质量下和最长的帧间隔时对应的传输最小比特率bps */                        UVC_MAKE_DWORD(UVC_MJPEG_MAX_BIT_RATE5),      /* dwMaxBitRate 指定默认压缩质量下和最短的帧间隔时对应的传输最大比特率bps */                        UVC_MAKE_DWORD(UVC_MJPEG_MAX_FRAME_SIZE5),   /* dwMaxVideoFrameBufferSize 帧压缩缓冲大小 */                        UVC_MAKE_DWORD(UVC_MJPEG_FRAME_DEFINTERVEL), /* dwDefaultFrameInterval 默认帧间隔 */                        0x01,                                        /* bFrameIntervalType 帧间隔配置方0:连续帧间1..255:离散帧间隔配置个*/                        UVC_MAKE_DWORD(UVC_MJPEG_FRAME_DEFINTERVEL), /* 帧间隔  单位 100ns */
                        /* 见 USB_Video_Payload_Uncompressed_1.5.pdf P83 Table 3-19 Color Matching Descriptor                            必须跟在Frame Descriptors后 一个格式描述符只能对应一个                         */                        6,                                    /* bLength */                        0x24,                                 /* bDescriptorType 描述符类型 见UVC 1.5 Class specification.pdf P171 Table A- 4 Video Class-Specific Descriptor Types CS_INTERFACE=0x24 */                        0x0D,                                 /* bDescriptorSubType : 见UVC 1.5 Class specification.pdf P172 Table A- 6 Video Class-Specific VS Interface Descriptor Subtypes VS_COLORFORMAT=0x0D  */                        0x01,                                 /* bColorPrimarie : 1: BT.709, sRGB (default) */                        0x01,                                 /* bTransferCharacteristics : 1: BT.709 (default) */                        0x04,                                 /* bMatrixCoefficients : 4: SMPTE 170M (BT.601,default) */
        /* 3.9.1 Standard VS Interface Descriptor alternate setting 1 */        0x09,   /* bLength   接口描述符长固定9字节            */        0x04,   /* bDescriptorType  bDescriptorType   见usb_20 P251 Table 9-5. Descriptor Types  INTERFACE=4         */        UVC_ITF_VS,   /* bInterfaceNumber  接口索引          */        0x01,         /* bAlternateSetting alt接口设置索引   */        0x01,         /* bNumEndpoints 本接口使用的端点个数(不含端点0) */        0x0E,         /* bInterfaceClass 见UVC 1.5 Class specification.pdf P171 Table A- 1 Video Interface Class Code  CC_VIDEO=0x0E */        0x02,         /* bInterfaceSubClass 见UVC 1.5 Class specification.pdf P171 Table A- 2 Video Interface Subclass Codes SC_VIDEOSTREAMING=0x02        */        0x00,         /* bInterfaceProtocol 见UVC 1.5 Class specification.pdf P171 Table A- 3 Video Interface Protocol Codes PC_PROTOCOL_UNDEFINED=0x00 */        0x00,         /* iInterface 字符串描述符索引 0:            */
        /* 3.10 VideoStreaming Endpoint Descriptors            3.10.1.1 Standard VS Isochronous Video Data Endpoint Descriptor            见UVC 1.5 Class specification.pdf P85 Table 3-20 Standard VS Isochronous Video Data Endpoint Descriptor        */        0x07,   /* bLength 端点描述符长固定7字节              */        0x05,   /* bDescriptorType 见usb_20.pdf P251 Table 9-5. Descriptor Types ENDPOINT=5           */        UVC_IN_ED,   /* bEndpointAddress    D7: 0 = OUT端点 1 = IN端点 D3..0: 端点*/        0x05,        /* bmAttributes D3..2: 同步类型ISO端点只能01 = Asynchronous  D1..0: 端点类型 01 = 同步端点 */        0xFF,        /* wMaxPacketSize 2字节 bit12:11表示一个微帧传几包 bit10:0包大*/        0x13,        0x01,       /* bInterval 2^(bInterval-1) SOF的间        */
    /********************************************************     *           以下是MIC+SPK部分     *******************************************************/    /**     * IAD描述符  参考InterfaceAssociationDescriptor_ecn P4    */    0x08,         /* bLength 本描述符长度,固定为8 */    0x0B,         /* bDescriptorType 描述符类型 INTERFACE_ASSOCIATION=0x0B 参考InterfaceAssociationDescriptor_ecn P3 */    SPK_AC_ITF,   /* bFirstInterface 本IAD下第一个接口 */    0x03,         /* bInterfaceCount 本IAD下接口数,默认一个控制接口一个SPK流接口一个MIC流接口 */    0x01,         /* bFunctionClass UAC是接口中说明类功能 这里应该是接口类 见https://www.usb.org/defined-class-codes (Audio=1) 见audio10.pdf P99 Table A-1: Audio Interface Class Code AUDIO=1 */    0x02,         /* bFunctionSubClass  UAC是接口中说明类功能 这里应该是接口类子类 见audio10.pdf P99 Table A-2: Audio Interface Subclass Codes AUDIOSTREAMING=0x02 */    0x00,         /* bFunctionProtocol UAC是接口中说明类功能 这里应该是接口协议号 见audio10.pdf P99 Table A-3: Audio Interface Protocol Codes PR_PROTOCOL_UNDEFINED=0x00  */    0x07,         /* iFunction 对应字符串索引                                */
        /********************************************************         *           控制接口部分         *******************************************************/        /* 接口描述符 UAC是接口描述符说明功能          * 见usb_20 P268 Table 9-12. Standard Interface Descriptor         */        0x09,         /* bLength                */        0x04,         /* bDescriptorType   见usb_20 P251 Table 9-5. Descriptor Types  INTERFACE=4   */        SPK_AC_ITF,   /* bInterfaceNumber       */        0x00,         /* bAlternateSetting      */        0x00,         /* bNumEndpoints 本接口下无端点*/        0x01,         /* bInterfaceClass    (Audio)  见audio10.pdf P99 Table A-1: Audio Interface Class Code AUDIO=1  */        0x01,         /* bInterfaceSubClass (Audio Control) 见audio10.pdf P99 Table A-2: Audio Interface Subclass Codes AUDIOCONTROL=0x01 */        0x00,         /* bInterfaceProtocol   见audio10.pdf P99 Table A-3: Audio Interface Protocol Codes PR_PROTOCOL_UNDEFINED=0x00  */        0x07,         /* iInterface 对应字符串索引           */
        /* BasicAudioDevice-10.pdf P57 Table 7-4: Headset Class-Specific AC Interface Header Descriptor */        0x0A,         /* bLength */        0x24,         /* bDescriptorType 见audio10.pdf P99 Table A-4: Audio Class-specific Descriptor Types CS_INTERFACE=0x24  */        0x01,         /* bDescriptorSubtype 见audio10.pdf P100 Table A-5: Audio Class-Specific AC Interface Descriptor Subtypes HEADER=0x01 */        0x00,0x01,    /* bcdADC Audio 1.0 */        0x46,0x00,    /* wTotalLength 本接口后续所有描述符的长度 从后面的bInCollection开始到本接口结束 */        0x02,         /* bInCollection 2个流接口 */        SPK_AS_ITF,   /* baInterfaceNr(1) SPK流接口号 */        MIC_AS_ITF,   /* baInterfaceNr(2) MIC流接口号 */
        /* BasicAudioDevice-10.pdf P22 Table 5-3: Mono Input Terminal Descriptor          * BasicAudioDevice-10.pdf P21 5.3.3.1.3 Headphone Input Terminal ID1 Descriptor         * BasicAudioDevice-10.pdf P58 7.3.3.1.3 Headset Input Terminal ID1 Descriptor        */        0x0C,         /* bLength */        0x24,         /* bDescriptorType 见audio10.pdf P99 Table A-4: Audio Class-specific Descriptor Types CS_INTERFACE=0x24 */        0x02,         /* bDescriptorSubtype 见audio10.pdf P100 Table A-5: Audio Class-Specific AC Interface Descriptor Subtypes INPUT_TERMINAL=0x02 */        SPK_INPUT_TID,/* bTerminalID TID=1*/        0x01,0x01,    /* wTerminalType TT Headphone Input Terminal 输入流 即USB OUT->本终端 本终端对应输入流 */        0x00,         /* bAssocTerminal */        UAC_SPK_CH,         /* bNrChannels 1个通道 */        0x04,0x00,    /* wChannelConfig Center Front channel. */        0x00,         /* iChannelNames 固定为0 */        0x00,         /* iTerminal 对应字符串描述符索引 */
        /* BasicAudioDevice-10.pdf P24 Table 5-5: Mono Feature Unit Descriptor          * BasicAudioDevice-10.pdf P59 7.3.3.1.7 Headset Feature Unit ID2 Descriptor         */        0x09,         /* bLength */        0x24,         /* bDescriptorType 见audio10.pdf P99 Table A-4: Audio Class-specific Descriptor Types CS_INTERFACE=0x24  */        0x06,         /* bDescriptorSubtype 见audio10.pdf P100 Table A-5: Audio Class-Specific AC Interface Descriptor Subtypes FEATURE_UNIT=0x06 */        SPK_FEATURE_TID,         /* bUnitID   */        SPK_INPUT_TID,           /* bSourceID */        0x01,                 /* bControlSize */        /**            A bit set to 1 indicates that the mentioned            Control is supported for master channel            0:            D0: Mute            D1: Volume            D2: Bass            D3: Mid            D4: Treble            D5: Graphic Equalizer            D6: Automatic Gain            D7: Delay            D8: Bass Boost            D9: Loudness            D10..(n*8-1): Reserved        */        0x01,                 /* bmaControls(0) Mute Control on Master Channel.*/        /*A bit set to 1 indicates that the mentioned          Control is supported for logical channel 1 */        0x02,                 /* bmaControls(1) Volume Control on Center Front channel */        0x00,         /* iFeature 对应字符串描述符索引 */
        /* BasicAudioDevice-10.pdf P25 Table 5-7: Headphone Output Terminal ID3 Descriptor          * BasicAudioDevice-10.pdf P67 7.3.3.1.16 Headset Output Terminal ID3 Descriptor        */        0x09,       /* bLength */        0x24,       /* bDescriptorType 见audio10.pdf P99 Table A-4: Audio Class-specific Descriptor Types CS_INTERFACE=0x24  */        0x03,       /* bDescriptorSubtype 见audio10.pdf P100 Table A-5: Audio Class-Specific AC Interface Descriptor Subtypes OUTPUT_TERMINAL=0x03 */        SPK_OUTPUT_TID,       /* bTerminalID */        0x01, 0x03,           /* 0x0301扬声器 0x0302耳机 Headphones Terminal Type (0x0302) 本终端->扬声器输出 本终端对应扬声器  */        0x00,                 /* bAssocTerminal */        SPK_FEATURE_TID,      /* bSourceID */        0x00,                 /* iTerminal */                   /* BasicAudioDevice-10.pdf P59 7.3.3.1.6 Headset Microphone Input Terminal ID4 Descriptor         * BasicAudioDevice-10.pdf P40 6.3.3.1.3 Microphone Input Terminal ID4 Descriptor         * BasicAudioDevice-10.pdf P22 Table 5-3: Mono Input Terminal Descriptor        */        0x0C,       /* bLength */        0x24,       /* bDescriptorType 见audio10.pdf P99 Table A-4: Audio Class-specific Descriptor Types CS_INTERFACE=0x24 */        0x02,       /* bDescriptorSubtype 见audio10.pdf P100 Table A-5: Audio Class-Specific AC Interface Descriptor Subtypes INPUT_TERMINAL=0x02 */        MIC_INPUT_TID,/* bTerminalID TID=4*/        0x01,0x02,    /* wTerminalType TT Terminal is Microphone.  麦克风输入->本终端  本终端对应麦克风 */        0x00,         /* bAssocTerminal */        UAC_MIC_CH,         /* bNrChannels 1个通道 */        0x00,0x00,    /* wChannelConfig Center Front channel. @todo 0x0000改为0004*/        0x00,         /* iChannelNames 固定为0 */        0x00,         /* iTerminal 对应字符串描述符索引 */
        /*         * BasicAudioDevice-10.pdf P60 7.3.3.1.10 Headset Feature Unit ID5 Descriptor        */        0x09,      /* bLength */        0x24,      /* bDescriptorType 见audio10.pdf P99 Table A-4: Audio Class-specific Descriptor Types CS_INTERFACE=0x24 */        0x06,      /* bDescriptorSubtype 见audio10.pdf P100 Table A-5: Audio Class-Specific AC Interface Descriptor Subtypes FEATURE_UNIT=0x06 */        MIC_FEATURE_TID,      /* bUnitID   */        MIC_INPUT_TID,        /* bSourceID */        0x01,                 /* bControlSize 这里配置不对会枚举失败 */        /**            A bit set to 1 indicates that the mentioned            Control is supported for master channel            0:            D0: Mute            D1: Volume            D2: Bass            D3: Mid            D4: Treble            D5: Graphic Equalizer            D6: Automatic Gain            D7: Delay            D8: Bass Boost            D9: Loudness            D10..(n*8-1): Reserved        */        0x43,                 /* bmaControls(0) Mute Control on Master Channel.*/        /*A bit set to 1 indicates that the mentioned          Control is supported for logical channel 1 */        0x00,                 /* bmaControls(1) Volume Control on Center Front channel */        0x00,                 /* iFeature 对应字符串描述符索引 */
        /* BasicAudioDevice-10.pdf P66 Table 7-12: Headset Selector Unit ID9 Descriptor for HS2 */        0x07,                 /* bLength */        0x24,                 /* bDescriptorType 见audio10.pdf P99 Table A-4: Audio Class-specific Descriptor Types CS_INTERFACE=0x24 */        0x05,                 /* bDescriptorSubtype 见audio10.pdf P100 Table A-5: Audio Class-Specific AC Interface Descriptor Subtypes SELECTOR_UNIT=0x05 */        MIC_SEL_TID,          /* bUnitID */        0x01,                 /* bNrInPins */        MIC_FEATURE_TID,      /* baSourceID(1) */        0x00,                 /* iSelector */
        /*         * BasicAudioDevice-10.pdf P67 7.3.3.1.17 Headset Output Terminal ID6 Descriptor        */        0x09,    /* bLength */        0x24,    /* bDescriptorType 见audio10.pdf P99 Table A-4: Audio Class-specific Descriptor Types CS_INTERFACE=0x24 */        0x03,    /* bDescriptorSubtype 见audio10.pdf P100 Table A-5: Audio Class-Specific AC Interface Descriptor Subtypes OUTPUT_TERMINAL=0x03 */        MIC_OUTPUT_TID,       /* bTerminalID */        0x01,0x01,            /* wTerminalType USB Streaming Terminal Type 本终端->USB IN 本终端对应输出流*/        0x02,                 /* bAssocTerminal */        MIC_SEL_TID,          /* bSourceID */        0x00,                 /* iTerminal */
        /********************************************************         *           SPK流部分         *******************************************************/
        /* 接口描述符        * usb_20.pdf P268 Table 9-12. Standard Interface Descriptor         * BasicAudioDevice-10.pdf P30  Table 5-13: Headphone Standard AS Interface Descriptor (Alt. Set. 0)        */        0x09,    /* bLength */        0x04,    /* bDescriptorType INTERFACE */        SPK_AS_ITF,    /* bInterfaceNumber */        0x00,    /* bAlternateSetting */        0x00,    /* bNumEndpoints */        0x01,    /* bInterfaceClass 见audio10.pdf P99 Table A-1: Audio Interface Class Code AUDIO=1  */        0x02,    /* bInterfaceSubClass 见audio10.pdf P99 Table A-2: Audio Interface Subclass Codes AUDIOSTREAMING=0x02 */        0x00,    /* bInterfaceProtocol 见audio10.pdf P99 Table A-3: Audio Interface Protocol Codes PR_PROTOCOL_UNDEFINED = 0x00 */        0x00,    /* iInterface         */
        /* 接口描述符        * usb_20.pdf P268 Table 9-12. Standard Interface Descriptor         BasicAudioDevice-10.pdf P31  Table 5-14: Headphone Standard AS Interface Descriptor (Alt. Set .1)        */        0x09,   /* bLength */        0x04,   /* bDescriptorType INTERFACE */        SPK_AS_ITF,   /* bInterfaceNumber */        0x01,   /* bAlternateSetting */        0x01,   /* bNumEndpoints 一个端点 */        0x01,   /* bInterfaceClass 见audio10.pdf P99 Table A-1: Audio Interface Class Code AUDIO=1 */        0x02,   /* bInterfaceSubClass 见audio10.pdf P99 Table A-2: Audio Interface Subclass Codes AUDIOSTREAMING=0x02 */        0x00,   /* bInterfaceProtocol 见audio10.pdf P99 Table A-3: Audio Interface Protocol Codes PR_PROTOCOL_UNDEFINED = 0x00 */        0x00,   /* iInterface         */
        /*         * BasicAudioDevice-10.pdf P31  Table 5-15: Headphone Class-specific AS General Interface Descriptor        */        0x07,   /* bLength */        0x24,   /* bDescriptorType 见audio10.pdf P99 Table A-4: Audio Class-specific Descriptor Types CS_INTERFACE=0x24  */        0x01,   /* bDescriptorSubtype 见audio10.pdf P100 Table A-6: Audio Class-Specific AS Interface Descriptor Subtypes AS_GENERAL=0x01 */        SPK_INPUT_TID,   /* bTerminalLink */        0x01,            /* bDelay Total interface delay, expressed in frames. Not used and shall be set to 0x00 */        0x01,0x00,       /* wFormatTag PCM Format */
        /*         * BasicAudioDevice-10.pdf P32 Table 5-16: Mono Headphone Type I Format Type Descriptor         */        0x0B,  /* bLength */        0x24,  /* bDescriptorType 见audio10.pdf P99 Table A-4: Audio Class-specific Descriptor Types CS_INTERFACE=0x24  */        0x02,  /* bDescriptorSubtype 见audio10.pdf P100 Table A-6: Audio Class-Specific AS Interface Descriptor Subtypes FORMAT_TYPE=0x02 */        0x01,  /* bFormatType 见frmts10.pdf P20 Table A-4: Format Type Codes FORMAT_TYPE_I=0x01 */        UAC_SPK_CH,  /* bNrChannels One channel. */        (UAC_SPK_BIT_RES/8)*UAC_SPK_CH,  /* bSubFrameSize Two bytes per audio subframe. */        UAC_SPK_BIT_RES,  /* bBitResolution 16 bits per sample */        0x01,  /* bSamFreqType One frequency supported. */        UVC_MAKE_U24(UAC_SPK_SAMP_REQ), /* tSamFreq  */
        /* 端点描述符         * usb_20.pdf P269 Table 9-13. Standard Endpoint Descriptor        * BasicAudioDevice-10.pdf P33 Table 5-18: Mono Headphone Standard AS Audio Data Endpoint Descriptor        */        0x09,  /* bLength */        0x05,  /* bDescriptorType 见usb_20.pdf P251 Table 9-5. Descriptor Types ENDPOINT=5 */        SPK_OUT_EP, /* bEndpointAddress */        0x09,  /* bmAttributes b[1:0] 01 = Isochronous, b[3:2] 11 = Synchronous */        UVC_MAKE_WORD((UAC_SPK_SAMP_REQ/1000)*(UAC_SPK_BIT_RES/8)*UAC_SPK_CH),/* wMaxPacketSize */        0x04,  /* bInterval 1ms一包 */        0x00,  /* bRefresh  */        0x00,  /* bSynchAddress */
        /*         * BasicAudioDevice-10.pdf P33 Table 5-20: Headphone Class-specific Isoc. Audio Data Endpoint Descriptor        */        0x07,  /* bLength                                */        0x25,  /* bDescriptorType 见audio10.pdf P99 Table A-4: Audio Class-specific Descriptor Types CS_ENDPOINT=0x25 */        0x01,  /* bDescriptorSubtype 见audio10.pdf P101 Table A-8: Audio Class-Specific Endpoint Descriptor Subtypes EP_GENERAL=0x01. */        0x00,  /* bmAttributes No sampling frequency control, no pitch control, no packet padding.*/        0x00,  /* bLockDelayUnits */        0x00,  0x00, /* wLockDelay */
        /********************************************************         *           MIC流部分         *******************************************************/        /* 接口描述符        * usb_20.pdf P268 Table 9-12. Standard Interface Descriptor         * BasicAudioDevice-10.pdf P30  Table 5-13: Headphone Standard AS Interface Descriptor (Alt. Set. 0)        */        0x09,    /* bLength */        0x04,    /* bDescriptorType INTERFACE */        MIC_AS_ITF,    /* bInterfaceNumber */        0x00,    /* bAlternateSetting */        0x00,    /* bNumEndpoints */        0x01,    /* bInterfaceClass 见audio10.pdf P99 Table A-1: Audio Interface Class Code AUDIO=1  */        0x02,    /* bInterfaceSubClass 见audio10.pdf P99 Table A-2: Audio Interface Subclass Codes AUDIOSTREAMING=0x02 */        0x00,    /* bInterfaceProtocol 见audio10.pdf P99 Table A-3: Audio Interface Protocol Codes PR_PROTOCOL_UNDEFINED = 0x00 */        0x00,    /* iInterface         */
        /* 接口描述符        * usb_20.pdf P268 Table 9-12. Standard Interface Descriptor         BasicAudioDevice-10.pdf P31  Table 5-14: Headphone Standard AS Interface Descriptor (Alt. Set .1)        */        0x09,   /* bLength */        0x04,   /* bDescriptorType INTERFACE */        MIC_AS_ITF,   /* bInterfaceNumber */        0x01,   /* bAlternateSetting */        0x01,   /* bNumEndpoints 一个端点 */        0x01,   /* bInterfaceClass 见audio10.pdf P99 Table A-1: Audio Interface Class Code AUDIO=1 */        0x02,   /* bInterfaceSubClass 见audio10.pdf P99 Table A-2: Audio Interface Subclass Codes AUDIOSTREAMING=0x02 */        0x00,   /* bInterfaceProtocol 见audio10.pdf P99 Table A-3: Audio Interface Protocol Codes PR_PROTOCOL_UNDEFINED = 0x00 */        0x00,   /* iInterface         */
        /*         * BasicAudioDevice-10.pdf P31  Table 5-15: Headphone Class-specific AS General Interface Descriptor        */        0x07,   /* bLength */        0x24,   /* bDescriptorType 见audio10.pdf P99 Table A-4: Audio Class-specific Descriptor Types CS_INTERFACE=0x24  */        0x01,   /* bDescriptorSubtype 见audio10.pdf P100 Table A-6: Audio Class-Specific AS Interface Descriptor Subtypes AS_GENERAL=0x01 */        MIC_OUTPUT_TID,   /* bTerminalLink */        0x01,            /* bDelay Total interface delay, expressed in frames. Not used and shall be set to 0x00 */        0x01,0x00,       /* wFormatTag PCM Format */
        /*         * BasicAudioDevice-10.pdf P32 Table 5-16: Mono Headphone Type I Format Type Descriptor         */        0x0B,  /* bLength */        0x24,  /* bDescriptorType 见audio10.pdf P99 Table A-4: Audio Class-specific Descriptor Types CS_INTERFACE=0x24  */        0x02,  /* bDescriptorSubtype 见audio10.pdf P100 Table A-6: Audio Class-Specific AS Interface Descriptor Subtypes FORMAT_TYPE=0x02 */        0x01,  /* bFormatType 见frmts10.pdf P20 Table A-4: Format Type Codes FORMAT_TYPE_I=0x01 */        UAC_MIC_CH,  /* bNrChannels One channel. */        (UAC_MIC_BIT_RES/8)*UAC_MIC_CH,  /* bSubFrameSize Two bytes per audio subframe. */        UAC_MIC_BIT_RES,  /* bBitResolution 16 bits per sample */        0x01,  /* bSamFreqType One frequency supported. */        UVC_MAKE_U24(UAC_MIC_SAMP_REQ), /* tSamFreq  */
        /* 端点描述符         * usb_20.pdf P269 Table 9-13. Standard Endpoint Descriptor        * BasicAudioDevice-10.pdf P33 Table 5-18: Mono Headphone Standard AS Audio Data Endpoint Descriptor        */        0x09,  /* bLength */        0x05,  /* bDescriptorType 见usb_20.pdf P251 Table 9-5. Descriptor Types ENDPOINT=5 */        MIC_IN_EP, /* bEndpointAddress */        0x05,  /* bmAttributes b[1:0] 01 = Isochronous, b[3:2] 11 = Synchronous */        UVC_MAKE_WORD((UAC_MIC_SAMP_REQ/1000)*(UAC_MIC_BIT_RES/8)*UAC_MIC_CH),/* wMaxPacketSize */        0x04,  /* bInterval 1ms一包 高速单位是微帧:2^(4-1)=8 间隔8个微帧发一包, 如果是全速则间隔是帧,2^(1-1)=1. */        0x00,  /* bRefresh  */        0x00,  /* bSynchAddress */
        /*         * BasicAudioDevice-10.pdf P33 Table 5-20: Headphone Class-specific Isoc. Audio Data Endpoint Descriptor        */        0x07,  /* bLength                                */        0x25,  /* bDescriptorType 见audio10.pdf P99 Table A-4: Audio Class-specific Descriptor Types CS_ENDPOINT=0x25 */        0x01,  /* bDescriptorSubtype 见audio10.pdf P101 Table A-8: Audio Class-Specific Endpoint Descriptor Subtypes EP_GENERAL=0x01. */        0x00,  /* bmAttributes No sampling frequency control, no pitch control, no packet padding.*/        0x00,  /* bLockDelayUnits */        0x00,  0x00, /* wLockDelay */
    /********************************************************     *           以下是CDC部分 59     *******************************************************/       /* Interface Association Descriptor */        0x08,    /* bLength */        0x0B,    /* bDescriptorType INTERFACE ASSOCIATION */        CDC_DEMO_CTRL_ITF1,       /* bFirstInterface*/        0x02,    /* bInterfaceCount*/        0x02,    /* bFunctionClass */        0x02,    /* bFunctionSubClass Communications and CDC Control */        0x01,    /* bFunctionProtocol  Abstract Control Model*/        0x00,    /* iFunction*/
        /* Interface Descriptors */        0x09,   /* bLength            */        0x04,   /* bDescriptorType        */        CDC_DEMO_CTRL_ITF1, /* bInterfaceNumber       */        0x00,   /* bAlternateSetting*/        0x00,   /* bNumEndpoints */        0x02,   /* bInterfaceClass    Communications Interface Class      */        0x02,   /* bInterfaceSubClass Abstract Control Model              */        0x01,   /* bInterfaceProtocol AT Commands: V.250 etc              */        0x00,   /* iInterface    */
        /* Header Functional Descriptor */        0x05,   /* bFunctionLength */        0x24,   /* bDescriptorType CS_INTERFACE */        0x00,   /* bDescriptorSubtype Header Functional Descriptor */        0x10,        0x01,   /* bcdCDC (0x0110)*/
        /* Call Management Functional Descriptor */        0x05,   /* bFunctionLength */        0x24,   /* bDescriptorType CS_INTERFACE */        0x01,   /* bDescriptorSubtype Call Management Functional Descriptor */        0x00,   /* bmCapabilities */        0x01,   /* bDataInterface */
        /* ACM Functional Descriptor */        0x04,   /* bFunctionLength */        0x24,   /* bDescriptorType CS_INTERFACE */        0x02,   /* bDescriptorSubtype Abstract Control Management Functional Descriptor */        0x02,   /* bmCapabilities */
        /* Union Functional Descriptor */        0x05,   /* bFunctionLength */        0x24,   /* bDescriptorType CS_INTERFACE */        0x06,   /* bDescriptorSubtype Union Descriptor Functional Descriptor */        0x00,   /* bControlInterface */        0x01,   /* bSubordinateInterface0 */
        //0x07, /* bLength               */        //0x05, /* bDescriptorType T          */        //CDC_DEMO_CTRLEP1,   /* bEndpointAddress    D7: 0 = OUT 1 = IN D3..0:*/        //0x03, /* bmAttributes Bulk*/        //0x00,   /* wMaxPacketSize 2 bit12:11  bit10:0*/        //0x02,        //0x01, /* bInterval 2^(bInterval-1) SOF        */
        /* Interface Descriptors */        0x09,   /* bLength            */        0x04,   /* bDescriptorType        */        CDC_DEMO_DATA_ITF1, /* bInterfaceNumber       */        0x00,   /* bAlternateSetting*/        0x02,   /* bNumEndpoints */        0x0A,   /* bInterfaceClass    Data Interface Class     */        0x00,   /* bInterfaceSubClass                          */        0x00,   /* bInterfaceProtocol                          */        0x00,   /* iInterface    */
        0x07,   /* bLength               */        0x05,   /* bDescriptorType ENDPOINT          */        CDC_DEMO_INEP1,   /* bEndpointAddress    D7: 0 = OUT 1 = IN D3..0:*/        0x02,   /* bmAttributes Bulk*/        0x00,   /* wMaxPacketSize 2 bit12:11 bit10:0*/        0x02,        0x00,   /* bInterval 2^(bInterval-1) SOF        */
        0x07,   /* bLength               */        0x05,   /* bDescriptorType ENDPOINT          */        CDC_DEMO_OUTEP1,   /* bEndpointAddress    D7: 0 = OUT 1 = IN D3..0: */        0x02,   /* bmAttributes Bulk */        0x00,   /* wMaxPacketSize 2 bit12:11 bit10:0*/        0x02,        0x00,   /* bInterval 2^(bInterval-1) SOF      */};

3.2UsbTreeView描述符

如下是UsbTreeView抓到的描述符



---------------------- Device Descriptor ----------------------bLength : 0x12 (18 bytes)bDescriptorType : 0x01 (Device Descriptor)bcdUSB : 0x200 (USB Version 2.0)bDeviceClass : 0xEF (Miscellaneous)bDeviceSubClass : 0x02bDeviceProtocol : 0x01 (IAD - Interface Association Descriptor)bMaxPacketSize0 : 0x40 (64 bytes)idVendor : 0x4C4A (Unknown Vendor)idProduct : 0x4C55bcdDevice : 0x0100iManufacturer : 0x01 (String Descriptor 1) Language 0x0409 : "xxxxx Technology"iProduct : 0x02 (String Descriptor 2) Language 0x0409 : "USB Composite Device"iSerialNumber : 0x00 (No String Descriptor)bNumConfigurations : 0x01 (1 Configuration)Data (HexDump) : 12 01 00 02 EF 02 01 40 4A 4C 55 4C 00 01 01 02 .......@JLUL.... 00 01 ..
------------------ Configuration Descriptor -------------------bLength : 0x09 (9 bytes)bDescriptorType : 0x02 (Configuration Descriptor)wTotalLength : 0x023A (570 bytes)bNumInterfaces : 0x07 (7 Interfaces)bConfigurationValue : 0x01 (Configuration 1)iConfiguration : 0x00 (No String Descriptor)bmAttributes : 0x80 D7: Reserved, set 1 : 0x01 D6: Self Powered : 0x00 (no) D5: Remote Wakeup : 0x00 (no) D4..0: Reserved, set 0 : 0x00MaxPower : 0xC8 (400 mA)Data (HexDump) : 09 02 3A 02 07 01 00 80 C8 08 0B 00 02 0E 03 00 ..:............. 05 09 04 00 00 00 0E 01 00 05 0D 24 01 00 01 50 ...........$...P 00 80 C3 C9 01 01 01 12 24 02 01 01 02 00 00 00 ........$....... 00 00 00 00 00 03 0A 00 00 0B 24 05 02 01 00 00 ..........$..... 02 7B 07 00 1D 24 06 03 70 33 F0 28 11 63 2E 4A .{...$..p3.(.c.J BA 2C 68 90 EB 33 40 16 08 01 02 04 FF FF FF FF .,h..3@......... 00 09 24 03 05 01 01 00 04 00 09 04 01 00 00 0E ..$............. 02 00 00 0F 24 01 01 B6 00 81 00 05 00 00 00 02 ....$........... 00 00 0B 24 06 01 05 00 01 00 00 00 00 1E 24 07 ...$..........$. 01 00 00 05 D0 02 00 00 2F 0D 00 00 5E 1A 00 20 ......../...^.. 1C 00 80 1A 06 00 01 80 1A 06 00 1E 24 07 02 00 ............$... 60 03 E0 01 00 C0 EE 05 00 80 DD 0B 00 A8 0C 00 `............... 80 1A 06 00 01 80 1A 06 00 1E 24 07 03 00 20 03 ..........$... . E0 01 00 40 7E 05 00 80 FC 0A 00 B8 0B 00 80 1A ...@~........... 06 00 01 80 1A 06 00 1E 24 07 04 00 80 02 E0 01 ........$....... 00 00 65 04 00 00 CA 08 00 60 09 00 80 1A 06 00 ..e......`...... 01 80 1A 06 00 1E 24 07 05 00 E0 01 40 01 00 80 ......$.....@... 32 02 00 00 65 04 00 B0 04 00 80 1A 06 00 01 80 2...e........... 1A 06 00 06 24 0D 01 01 04 09 04 01 01 01 0E 02 ....$........... 00 00 07 05 81 05 FF 13 01 08 0B 02 03 01 02 00 ................ 07 09 04 02 00 00 01 01 00 07 0A 24 01 00 01 46 ...........$...F 00 02 03 04 0C 24 02 01 01 01 00 01 04 00 00 00 .....$.......... 09 24 06 02 01 01 01 02 00 09 24 03 03 01 03 00 .$........$..... 02 00 0C 24 02 04 01 02 00 01 00 00 00 00 09 24 ...$...........$ 06 05 04 01 43 00 00 07 24 05 07 01 05 00 09 24 ....C...$......$ 03 06 01 01 02 07 00 09 04 03 00 00 01 02 00 00 ................ 09 04 03 01 01 01 02 00 00 07 24 01 01 01 01 00 ..........$..... 0B 24 02 01 01 02 10 01 80 3E 00 09 05 02 09 20 .$.......>..... 00 04 00 00 07 25 01 00 00 00 00 09 04 04 00 00 .....%.......... 01 02 00 00 09 04 04 01 01 01 02 00 00 07 24 01 ..............$. 06 01 01 00 0B 24 02 01 01 02 10 01 80 3E 00 09 .....$.......>.. 05 82 05 20 00 04 00 00 07 25 01 00 00 00 00 08 ... .....%...... 0B 05 02 02 02 01 00 09 04 05 00 00 02 02 01 00 ................ 05 24 00 10 01 05 24 01 00 01 04 24 02 02 05 24 .$....$....$...$ 06 00 01 09 04 06 00 02 0A 00 00 00 07 05 83 02 ................ 00 02 00 07 05 03 02 00 02 00 ..........
------------------- IAD Descriptor --------------------bLength : 0x08 (8 bytes)bDescriptorType : 0x0B (Interface Association Descriptor)bFirstInterface : 0x00 (Interface 0)bInterfaceCount : 0x02 (2 Interfaces)bFunctionClass : 0x0E (Video)bFunctionSubClass : 0x03 (Video Interface Collection)bFunctionProtocol : 0x00 (PC_PROTOCOL_UNDEFINED)iFunction : 0x05 (String Descriptor 5) Language 0x0409 : "XXXX USB CAMERA"Data (HexDump) : 08 0B 00 02 0E 03 00 05 ........
---------------- Interface Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x04 (Interface Descriptor)bInterfaceNumber : 0x00 (Interface 0)bAlternateSetting : 0x00bNumEndpoints : 0x00 (Default Control Pipe only)bInterfaceClass : 0x0E (Video)bInterfaceSubClass : 0x01 (Video Control)bInterfaceProtocol : 0x00iInterface : 0x05 (String Descriptor 5) Language 0x0409 : "XXXX USB CAMERA"Data (HexDump) : 09 04 00 00 00 0E 01 00 05 .........
------- Video Control Interface Header Descriptor -----bLength : 0x0D (13 bytes)bDescriptorType : 0x24 (Video Control Interface)bDescriptorSubtype : 0x01 (Video Control Header)bcdUVC : 0x0100 (UVC Version 1.00)wTotalLength : 0x0050 (80 bytes)dwClockFreq : 0x01C9C380 (30 MHz)bInCollection : 0x01 (1 VideoStreaming interface)baInterfaceNr[1] : 0x01 (Interface 1)Data (HexDump) : 0D 24 01 00 01 50 00 80 C3 C9 01 01 01 .$...P.......
-------- Video Control Input Terminal Descriptor ------bLength : 0x12 (18 bytes)bDescriptorType : 0x24 (Video Control Interface)bDescriptorSubtype : 0x02 (Input Terminal)bTerminalID : 0x01 (1)wTerminalType : 0x0201 (ITT_CAMERA)bAssocTerminal : 0x00 (Not associated with an Output Terminal)iTerminal : 0x00 (No String Descriptor)Camera Input Terminal Data:wObjectiveFocalLengthMin : 0x0000wObjectiveFocalLengthMax : 0x0000wOcularFocalLength : 0x0000bControlSize : 0x03 (3 bytes)bmControls : 0x0A, 0x00, 0x00 D0 : 0 no - Scanning Mode D1 : 1 yes - Auto-Exposure Mode D2 : 0 no - Auto-Exposure Priority D3 : 1 yes - Exposure Time (Absolute) D4 : 0 no - Exposure Time (Relative) D5 : 0 no - Focus (Absolute) D6 : 0 no - Focus (Relative) D7 : 0 no - Iris (Absolute) D8 : 0 no - Iris (Relative) D9 : 0 no - Zoom (Absolute) D10 : 0 no - Zoom (Relative) D11 : 0 no - Pan (Absolute) D12 : 0 no - Pan (Relative) D13 : 0 no - Roll (Absolute) D14 : 0 no - Roll (Relative) D15 : 0 no - Tilt (Absolute) D16 : 0 no - Tilt (Relative) D17 : 0 no - Focus Auto D18 : 0 no - Reserved D19 : 0 no - Reserved D20 : 0 no - Reserved D21 : 0 no - Reserved D22 : 0 no - Reserved D23 : 0 no - ReservedData (HexDump) : 12 24 02 01 01 02 00 00 00 00 00 00 00 00 03 0A .$.............. 00 00 ..
-------- Video Control Processing Unit Descriptor -----bLength : 0x0B (11 bytes)bDescriptorType : 0x24 (Video Control Interface)bDescriptorSubtype : 0x05 (Processing Unit)bUnitID : 0x02 (2)bSourceID : 0x01 (1)wMaxMultiplier : 0x0000bControlSize : 0x02 (2 bytes)bmControls : 0x7B, 0x07 D0 : 1 yes - Brightness D1 : 1 yes - Contrast D2 : 0 no - Hue D3 : 1 yes - Saturation D4 : 1 yes - Sharpness D5 : 1 yes - Gamma D6 : 1 yes - White Balance Temperature D7 : 0 no - White Balance Component D8 : 1 yes - Backlight Compensation D9 : 1 yes - Gain D10 : 1 yes - Power Line Frequency D11 : 0 no - Hue, Auto D12 : 0 no - White Balance Temperature, Auto D13 : 0 no - White Balance Component, Auto D14 : 0 no - Digital Multiplier D15 : 0 no - Digital Multiplier LimitiProcessing : 0x00 (No String Descriptor)Data (HexDump) : 0B 24 05 02 01 00 00 02 7B 07 00 .$......{..
--------- Video Control Extension Unit Descriptor -----bLength : 0x1D (29 bytes)bDescriptorType : 0x24 (Video Control Interface)bDescriptorSubtype : 0x06 (Extension Unit)bUnitID : 0x03 (ID 3)guidExtensionCode : {28F03370-6311-4A2E-BA2C-6890EB334016}bNumControls : 0x08 (8 Controls)bNrInPins : 0x01 (1 Input Pin)baSourceID[1] : 0x02bControlSize : 0x04 (4 bytes)bmControls : 0xFF, 0xFF, 0xFF, 0xFF D0 : 1 yes - Vendor-Specific (Optional) D1 : 1 yes - Vendor-Specific (Optional) D2 : 1 yes - Vendor-Specific (Optional) D3 : 1 yes - Vendor-Specific (Optional) D4 : 1 yes - Vendor-Specific (Optional) D5 : 1 yes - Vendor-Specific (Optional) D6 : 1 yes - Vendor-Specific (Optional) D7 : 1 yes - Vendor-Specific (Optional) D8 : 1 yes - Vendor-Specific (Optional) D9 : 1 yes - Vendor-Specific (Optional) D10 : 1 yes - Vendor-Specific (Optional) D11 : 1 yes - Vendor-Specific (Optional) D12 : 1 yes - Vendor-Specific (Optional) D13 : 1 yes - Vendor-Specific (Optional) D14 : 1 yes - Vendor-Specific (Optional) D15 : 1 yes - Vendor-Specific (Optional) D16 : 1 yes - Vendor-Specific (Optional) D17 : 1 yes - Vendor-Specific (Optional) D18 : 1 yes - Vendor-Specific (Optional) D19 : 1 yes - Vendor-Specific (Optional) D20 : 1 yes - Vendor-Specific (Optional) D21 : 1 yes - Vendor-Specific (Optional) D22 : 1 yes - Vendor-Specific (Optional) D23 : 1 yes - Vendor-Specific (Optional) D24 : 1 yes - Vendor-Specific (Optional) D25 : 1 yes - Vendor-Specific (Optional) D26 : 1 yes - Vendor-Specific (Optional) D27 : 1 yes - Vendor-Specific (Optional) D28 : 1 yes - Vendor-Specific (Optional) D29 : 1 yes - Vendor-Specific (Optional) D30 : 1 yes - Vendor-Specific (Optional) D31 : 1 yes - Vendor-Specific (Optional)iExtension : 0x00 (No String Descriptor)Data (HexDump) : 1D 24 06 03 70 33 F0 28 11 63 2E 4A BA 2C 68 90 .$..p3.(.c.J.,h. EB 33 40 16 08 01 02 04 FF FF FF FF 00 .3@..........
------- Video Control Output Terminal Descriptor ------bLength : 0x09 (9 bytes)bDescriptorType : 0x24 (Video Control Interface)bDescriptorSubtype : 0x03 (Output Terminal)bTerminalID : 0x05 (5)wTerminalType : 0x0101 (TT_STREAMING)bAssocTerminal : 0x00 (Not associated with an Input Terminal)bSourceID : 0x04 (4)iTerminal : 0x00 (No String Descriptor)Data (HexDump) : 09 24 03 05 01 01 00 04 00 .$.......
---------------- Interface Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x04 (Interface Descriptor)bInterfaceNumber : 0x01 (Interface 1)bAlternateSetting : 0x00bNumEndpoints : 0x00 (Default Control Pipe only)bInterfaceClass : 0x0E (Video)bInterfaceSubClass : 0x02 (Video Streaming)bInterfaceProtocol : 0x00iInterface : 0x00 (No String Descriptor)Data (HexDump) : 09 04 01 00 00 0E 02 00 00 .........
---- VC-Specific VS Video Input Header Descriptor -----bLength : 0x0F (15 bytes)bDescriptorType : 0x24 (Video Streaming Interface)bDescriptorSubtype : 0x01 (Input Header)bNumFormats : 0x01wTotalLength : 0x00B6 (182 bytes)bEndpointAddress : 0x81 (Direction=IN EndpointID=1)bmInfo : 0x00 (Dynamic Format Change not supported)bTerminalLink : 0x05 (Output Terminal ID 5)bStillCaptureMethod : 0x00 (No Still Capture)nbTriggerSupport : 0x00 (Hardware Triggering not supported)bTriggerUsage : 0x00 (Host will initiate still image capture)bControlSize : 0x02 (2 bytes each)Video Payload Format 1 : 0x00 0x00 D0 : 0 no - Key Frame Rate D1 : 0 no - P Frame Rate D2 : 0 no - Compression Quality D3 : 0 no - Compression Window Size D4 : 0 no - Generate Key Frame D5 : 0 no - Update Frame Segment D6 : 0 no - Reserved D7 : 0 no - ReservedData (HexDump) : 0F 24 01 01 B6 00 81 00 05 00 00 00 02 00 00 .$.............
----- Video Streaming MJPEG Format Type Descriptor ----bLength : 0x0B (11 bytes)bDescriptorType : 0x24 (Video Streaming Interface)bDescriptorSubtype : 0x06 (Format MJPEG)bFormatIndex : 0x01 (1)bNumFrameDescriptors : 0x05 (5)bmFlags : 0x00 (Sample size is not fixed)bDefaultFrameIndex : 0x01 (1)bAspectRatioX : 0x00bAspectRatioY : 0x00bmInterlaceFlags : 0x00 D0 IL stream or variable: 0 (no) D1 Fields per frame : 0 (2 fields) D2 Field 1 first : 0 (no) D3 Reserved : 0 D4..5 Field pattern : 0 (Field 1 only) D6..7 Display Mode : 0 (Bob only)bCopyProtect : 0x00 (No restrictions)Data (HexDump) : 0B 24 06 01 05 00 01 00 00 00 00 .$.........
----- Video Streaming MJPEG Frame Type Descriptor --------> This is the Default (optimum) Frame indexbLength : 0x1E (30 bytes)bDescriptorType : 0x24 (Video Streaming Interface)bDescriptorSubtype : 0x07 (MJPEG Frame Type)bFrameIndex : 0x01bmCapabilities : 0x00wWidth : 0x0500 (1280)wHeight : 0x02D0 (720)dwMinBitRate : 0x0D2F0000 (221184000 bps -> 27.648 MB/s)dwMaxBitRate : 0x1A5E0000 (442368000 bps -> 55.296 MB/s)dwMaxVideoFrameBufferSize: 0x001C2000 (1843200 bytes)dwDefaultFrameInterval : 0x00061A80 (40.0000 ms -> 25.0000 fps)bFrameIntervalType : 0x01 (1 discrete frame interval supported)*!*WARNING: if bFrameIntervalType is 1 then dwMinBitRate should equal dwMaxBitRateadwFrameInterval[1] : 0x00061A80 (40.0000 ms -> 25.0000 fps)Data (HexDump) : 1E 24 07 01 00 00 05 D0 02 00 00 2F 0D 00 00 5E .$........./...^ 1A 00 20 1C 00 80 1A 06 00 01 80 1A 06 00 .. ...........
----- Video Streaming MJPEG Frame Type Descriptor -----bLength : 0x1E (30 bytes)bDescriptorType : 0x24 (Video Streaming Interface)bDescriptorSubtype : 0x07 (MJPEG Frame Type)bFrameIndex : 0x02bmCapabilities : 0x00wWidth : 0x0360 (864)wHeight : 0x01E0 (480)dwMinBitRate : 0x05EEC000 (99532800 bps -> 12.441 MB/s)dwMaxBitRate : 0x0BDD8000 (199065600 bps -> 24.883 MB/s)dwMaxVideoFrameBufferSize: 0x000CA800 (829440 bytes)dwDefaultFrameInterval : 0x00061A80 (40.0000 ms -> 25.0000 fps)bFrameIntervalType : 0x01 (1 discrete frame interval supported)*!*WARNING: if bFrameIntervalType is 1 then dwMinBitRate should equal dwMaxBitRateadwFrameInterval[1] : 0x00061A80 (40.0000 ms -> 25.0000 fps)Data (HexDump) : 1E 24 07 02 00 60 03 E0 01 00 C0 EE 05 00 80 DD .$...`.......... 0B 00 A8 0C 00 80 1A 06 00 01 80 1A 06 00 ..............
----- Video Streaming MJPEG Frame Type Descriptor -----bLength : 0x1E (30 bytes)bDescriptorType : 0x24 (Video Streaming Interface)bDescriptorSubtype : 0x07 (MJPEG Frame Type)bFrameIndex : 0x03bmCapabilities : 0x00wWidth : 0x0320 (800)wHeight : 0x01E0 (480)dwMinBitRate : 0x057E4000 (92160000 bps -> 11.520 MB/s)dwMaxBitRate : 0x0AFC8000 (184320000 bps -> 23.40 MB/s)dwMaxVideoFrameBufferSize: 0x000BB800 (768000 bytes)dwDefaultFrameInterval : 0x00061A80 (40.0000 ms -> 25.0000 fps)bFrameIntervalType : 0x01 (1 discrete frame interval supported)*!*WARNING: if bFrameIntervalType is 1 then dwMinBitRate should equal dwMaxBitRateadwFrameInterval[1] : 0x00061A80 (40.0000 ms -> 25.0000 fps)Data (HexDump) : 1E 24 07 03 00 20 03 E0 01 00 40 7E 05 00 80 FC .$... ....@~.... 0A 00 B8 0B 00 80 1A 06 00 01 80 1A 06 00 ..............
----- Video Streaming MJPEG Frame Type Descriptor -----bLength : 0x1E (30 bytes)bDescriptorType : 0x24 (Video Streaming Interface)bDescriptorSubtype : 0x07 (MJPEG Frame Type)bFrameIndex : 0x04bmCapabilities : 0x00wWidth : 0x0280 (640)wHeight : 0x01E0 (480)dwMinBitRate : 0x04650000 (73728000 bps -> 9.216 MB/s)dwMaxBitRate : 0x08CA0000 (147456000 bps -> 18.432 MB/s)dwMaxVideoFrameBufferSize: 0x00096000 (614400 bytes)dwDefaultFrameInterval : 0x00061A80 (40.0000 ms -> 25.0000 fps)bFrameIntervalType : 0x01 (1 discrete frame interval supported)*!*WARNING: if bFrameIntervalType is 1 then dwMinBitRate should equal dwMaxBitRateadwFrameInterval[1] : 0x00061A80 (40.0000 ms -> 25.0000 fps)Data (HexDump) : 1E 24 07 04 00 80 02 E0 01 00 00 65 04 00 00 CA .$.........e.... 08 00 60 09 00 80 1A 06 00 01 80 1A 06 00 ..`...........
----- Video Streaming MJPEG Frame Type Descriptor -----bLength : 0x1E (30 bytes)bDescriptorType : 0x24 (Video Streaming Interface)bDescriptorSubtype : 0x07 (MJPEG Frame Type)bFrameIndex : 0x05bmCapabilities : 0x00wWidth : 0x01E0 (480)wHeight : 0x0140 (320)dwMinBitRate : 0x02328000 (36864000 bps -> 4.608 MB/s)dwMaxBitRate : 0x04650000 (73728000 bps -> 9.216 MB/s)dwMaxVideoFrameBufferSize: 0x0004B000 (307200 bytes)dwDefaultFrameInterval : 0x00061A80 (40.0000 ms -> 25.0000 fps)bFrameIntervalType : 0x01 (1 discrete frame interval supported)*!*WARNING: if bFrameIntervalType is 1 then dwMinBitRate should equal dwMaxBitRateadwFrameInterval[1] : 0x00061A80 (40.0000 ms -> 25.0000 fps)Data (HexDump) : 1E 24 07 05 00 E0 01 40 01 00 80 32 02 00 00 65 .$.....@...2...e 04 00 B0 04 00 80 1A 06 00 01 80 1A 06 00 ..............
------- VS Color Matching Descriptor Descriptor -------bLength : 0x06 (6 bytes)bDescriptorType : 0x24 (Video Streaming Interface)bDescriptorSubtype : 0x0D (Color Matching)bColorPrimaries : 0x01 (BT.709, sRGB)bTransferCharacteristics : 0x01 (BT.709)bMatrixCoefficients : 0x04 (SMPTE 170M)Data (HexDump) : 06 24 0D 01 01 04 .$....
---------------- Interface Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x04 (Interface Descriptor)bInterfaceNumber : 0x01 (Interface 1)bAlternateSetting : 0x01bNumEndpoints : 0x01 (1 Endpoint)bInterfaceClass : 0x0E (Video)bInterfaceSubClass : 0x02 (Video Streaming)bInterfaceProtocol : 0x00iInterface : 0x00 (No String Descriptor)Data (HexDump) : 09 04 01 01 01 0E 02 00 00 .........
----------------- Endpoint Descriptor -----------------bLength : 0x07 (7 bytes)bDescriptorType : 0x05 (Endpoint Descriptor)bEndpointAddress : 0x81 (Direction=IN EndpointID=1)bmAttributes : 0x05 (TransferType=Isochronous SyncType=Asynchronous EndpointType=Data)wMaxPacketSize : 0x13FF Bits 15..13 : 0x00 (reserved, must be zero) Bits 12..11 : 0x02 (2 additional transactions per microframe -> allows 683..1024 bytes per packet) Bits 10..0 : 0x3FF (1023 bytes per packet)bInterval : 0x01 (1 microframe -> 0.125 ms)Data (HexDump) : 07 05 81 05 FF 13 01 .......
------------------- IAD Descriptor --------------------bLength : 0x08 (8 bytes)bDescriptorType : 0x0B (Interface Association Descriptor)bFirstInterface : 0x02 (Interface 2)bInterfaceCount : 0x03 (3 Interfaces)bFunctionClass : 0x01 (Audio)bFunctionSubClass : 0x02 (Audio Streaming)bFunctionProtocol : 0x00iFunction : 0x07 (String Descriptor 7) Language 0x0409 : "USB Audio"Data (HexDump) : 08 0B 02 03 01 02 00 07 ........
---------------- Interface Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x04 (Interface Descriptor)bInterfaceNumber : 0x02 (Interface 2)bAlternateSetting : 0x00bNumEndpoints : 0x00 (Default Control Pipe only)bInterfaceClass : 0x01 (Audio)bInterfaceSubClass : 0x01 (Audio Control)bInterfaceProtocol : 0x00iInterface : 0x07 (String Descriptor 7) Language 0x0409 : "USB Audio"Data (HexDump) : 09 04 02 00 00 01 01 00 07 .........
------ Audio Control Interface Header Descriptor ------bLength : 0x0A (10 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x01 (Header)bcdADC : 0x0100wTotalLength : 0x0046 (70 bytes)bInCollection : 0x02baInterfaceNr[1] : 0x03baInterfaceNr[2] : 0x04Data (HexDump) : 0A 24 01 00 01 46 00 02 03 04 .$...F....
------- Audio Control Input Terminal Descriptor -------bLength : 0x0C (12 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x02 (Input Terminal)bTerminalID : 0x01wTerminalType : 0x0101 (USB Streaming)bAssocTerminal : 0x00bNrChannels : 0x01 (1 channel)wChannelConfig : 0x0004 (C)iChannelNames : 0x00 (No String Descriptor)iTerminal : 0x00 (No String Descriptor)Data (HexDump) : 0C 24 02 01 01 01 00 01 04 00 00 00 .$..........
-------- Audio Control Feature Unit Descriptor --------bLength : 0x09 (9 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x06 (Feature Unit)bUnitID : 0x02 (2)bSourceID : 0x01 (1)bControlSize : 0x01 (1 byte per control)bmaControls[0] : 0x01 D0: Mute : 1 D1: Volume : 0 D2: Bass : 0 D3: Mid : 0 D4: Treble : 0 D5: Graphic Equalizer : 0 D6: Automatic Gain : 0 D7: Delay : 0bmaControls[1] : 0x02 D0: Mute : 0 D1: Volume : 1 D2: Bass : 0 D3: Mid : 0 D4: Treble : 0 D5: Graphic Equalizer : 0 D6: Automatic Gain : 0 D7: Delay : 0iFeature : 0x00 (No String Descriptor)Data (HexDump) : 09 24 06 02 01 01 01 02 00 .$.......
------- Audio Control Output Terminal Descriptor ------bLength : 0x09 (9 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x03 (Output Terminal)bTerminalID : 0x03wTerminalType : 0x0301 (Speaker)bAssocTerminal : 0x00 (0)bSourceID : 0x02 (2)iTerminal : 0x00 (No String Descriptor)Data (HexDump) : 09 24 03 03 01 03 00 02 00 .$.......
------- Audio Control Input Terminal Descriptor -------bLength : 0x0C (12 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x02 (Input Terminal)bTerminalID : 0x04wTerminalType : 0x0201 (Microphone)bAssocTerminal : 0x00bNrChannels : 0x01 (1 channel)wChannelConfig : 0x0000 (-)iChannelNames : 0x00 (No String Descriptor)iTerminal : 0x00 (No String Descriptor)Data (HexDump) : 0C 24 02 04 01 02 00 01 00 00 00 00 .$..........
-------- Audio Control Feature Unit Descriptor --------bLength : 0x09 (9 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x06 (Feature Unit)bUnitID : 0x05 (5)bSourceID : 0x04 (4)bControlSize : 0x01 (1 byte per control)bmaControls[0] : 0x43 D0: Mute : 1 D1: Volume : 1 D2: Bass : 0 D3: Mid : 0 D4: Treble : 0 D5: Graphic Equalizer : 0 D6: Automatic Gain : 1 D7: Delay : 0bmaControls[1] : 0x00 D0: Mute : 0 D1: Volume : 0 D2: Bass : 0 D3: Mid : 0 D4: Treble : 0 D5: Graphic Equalizer : 0 D6: Automatic Gain : 0 D7: Delay : 0iFeature : 0x00 (No String Descriptor)Data (HexDump) : 09 24 06 05 04 01 43 00 00 .$....C..
------- Audio Control Selector Unit Descriptor --------bLength : 0x07 (7 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x05 (Selector Unit)bUnitID : 0x07bNrInPins : 0x01 (1 Input Pin)baSourceID[1] : 0x05 (5)iSelector : 0x00 (No String Descriptor)Data (HexDump) : 07 24 05 07 01 05 00 .$.....
------- Audio Control Output Terminal Descriptor ------bLength : 0x09 (9 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x03 (Output Terminal)bTerminalID : 0x06wTerminalType : 0x0101 (USB Streaming)bAssocTerminal : 0x02 (2)bSourceID : 0x07 (7)iTerminal : 0x00 (No String Descriptor)Data (HexDump) : 09 24 03 06 01 01 02 07 00 .$.......
---------------- Interface Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x04 (Interface Descriptor)bInterfaceNumber : 0x03 (Interface 3)bAlternateSetting : 0x00bNumEndpoints : 0x00 (Default Control Pipe only)bInterfaceClass : 0x01 (Audio)bInterfaceSubClass : 0x02 (Audio Streaming)bInterfaceProtocol : 0x00iInterface : 0x00 (No String Descriptor)Data (HexDump) : 09 04 03 00 00 01 02 00 00 .........
---------------- Interface Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x04 (Interface Descriptor)bInterfaceNumber : 0x03 (Interface 3)bAlternateSetting : 0x01bNumEndpoints : 0x01 (1 Endpoint)bInterfaceClass : 0x01 (Audio)bInterfaceSubClass : 0x02 (Audio Streaming)bInterfaceProtocol : 0x00iInterface : 0x00 (No String Descriptor)Data (HexDump) : 09 04 03 01 01 01 02 00 00 .........
-------- Audio Streaming Interface Descriptor ---------bLength : 0x07 (7 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x01 (AS_GENERAL)bTerminalLink : 0x01 (Terminal ID 1)bDelay : 0x01 (1 frame)wFormatTag : 0x0001 (PCM)Data (HexDump) : 07 24 01 01 01 01 00 .$.....
------- Audio Streaming Format Type Descriptor --------bLength : 0x0B (11 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x02 (Format Type)bFormatType : 0x01 (FORMAT_TYPE_I)bNrChannels : 0x01 (1 channel)bSubframeSize : 0x02 (2 bytes per subframe)bBitResolution : 0x10 (16 bits per sample)bSamFreqType : 0x01 (supports 1 sample frequence)tSamFreq[1] : 0x03E80 (16000 Hz)Data (HexDump) : 0B 24 02 01 01 02 10 01 80 3E 00 .$.......>.
----------------- Endpoint Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x05 (Endpoint Descriptor)bEndpointAddress : 0x02 (Direction=OUT EndpointID=2)bmAttributes : 0x09 (TransferType=Isochronous SyncType=Adaptive EndpointType=Data)wMaxPacketSize : 0x0020 Bits 15..13 : 0x00 (reserved, must be zero) Bits 12..11 : 0x00 (0 additional transactions per microframe -> allows 1..1024 bytes per packet) Bits 10..0 : 0x20 (32 bytes per packet)bInterval : 0x04 (4 ms)bRefresh : 0x00bSynchAddress : 0x00Data (HexDump) : 09 05 02 09 20 00 04 00 00 .... ....
----------- Audio Data Endpoint Descriptor ------------bLength : 0x07 (7 bytes)bDescriptorType : 0x25 (Audio Endpoint Descriptor)bDescriptorSubtype : 0x01 (General)bmAttributes : 0x00 D0 : Sampling Freq : 0x00 (not supported) D1 : Pitch : 0x00 (not supported) D6..2: Reserved : 0x00 D7 : MaxPacketsOnly : 0x00 (no)bLockDelayUnits : 0x00 (Undefined)wLockDelay : 0x0000Data (HexDump) : 07 25 01 00 00 00 00 .%.....
---------------- Interface Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x04 (Interface Descriptor)bInterfaceNumber : 0x04 (Interface 4)bAlternateSetting : 0x00bNumEndpoints : 0x00 (Default Control Pipe only)bInterfaceClass : 0x01 (Audio)bInterfaceSubClass : 0x02 (Audio Streaming)bInterfaceProtocol : 0x00iInterface : 0x00 (No String Descriptor)Data (HexDump) : 09 04 04 00 00 01 02 00 00 .........
---------------- Interface Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x04 (Interface Descriptor)bInterfaceNumber : 0x04 (Interface 4)bAlternateSetting : 0x01bNumEndpoints : 0x01 (1 Endpoint)bInterfaceClass : 0x01 (Audio)bInterfaceSubClass : 0x02 (Audio Streaming)bInterfaceProtocol : 0x00iInterface : 0x00 (No String Descriptor)Data (HexDump) : 09 04 04 01 01 01 02 00 00 .........
-------- Audio Streaming Interface Descriptor ---------bLength : 0x07 (7 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x01 (AS_GENERAL)bTerminalLink : 0x06 (Terminal ID 6)bDelay : 0x01 (1 frame)wFormatTag : 0x0001 (PCM)Data (HexDump) : 07 24 01 06 01 01 00 .$.....
------- Audio Streaming Format Type Descriptor --------bLength : 0x0B (11 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x02 (Format Type)bFormatType : 0x01 (FORMAT_TYPE_I)bNrChannels : 0x01 (1 channel)bSubframeSize : 0x02 (2 bytes per subframe)bBitResolution : 0x10 (16 bits per sample)bSamFreqType : 0x01 (supports 1 sample frequence)tSamFreq[1] : 0x03E80 (16000 Hz)Data (HexDump) : 0B 24 02 01 01 02 10 01 80 3E 00 .$.......>.
----------------- Endpoint Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x05 (Endpoint Descriptor)bEndpointAddress : 0x82 (Direction=IN EndpointID=2)bmAttributes : 0x05 (TransferType=Isochronous SyncType=Asynchronous EndpointType=Data)wMaxPacketSize : 0x0020 Bits 15..13 : 0x00 (reserved, must be zero) Bits 12..11 : 0x00 (0 additional transactions per microframe -> allows 1..1024 bytes per packet) Bits 10..0 : 0x20 (32 bytes per packet)bInterval : 0x04 (4 ms)bRefresh : 0x00bSynchAddress : 0x00Data (HexDump) : 09 05 82 05 20 00 04 00 00 .... ....
----------- Audio Data Endpoint Descriptor ------------bLength : 0x07 (7 bytes)bDescriptorType : 0x25 (Audio Endpoint Descriptor)bDescriptorSubtype : 0x01 (General)bmAttributes : 0x00 D0 : Sampling Freq : 0x00 (not supported) D1 : Pitch : 0x00 (not supported) D6..2: Reserved : 0x00 D7 : MaxPacketsOnly : 0x00 (no)bLockDelayUnits : 0x00 (Undefined)wLockDelay : 0x0000Data (HexDump) : 07 25 01 00 00 00 00 .%.....
------------------- IAD Descriptor --------------------bLength : 0x08 (8 bytes)bDescriptorType : 0x0B (Interface Association Descriptor)bFirstInterface : 0x05 (Interface 5)bInterfaceCount : 0x02 (2 Interfaces)bFunctionClass : 0x02 (Communications and CDC Control)bFunctionSubClass : 0x02bFunctionProtocol : 0x01iFunction : 0x00 (No String Descriptor)Data (HexDump) : 08 0B 05 02 02 02 01 00 ........
---------------- Interface Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x04 (Interface Descriptor)bInterfaceNumber : 0x05 (Interface 5)bAlternateSetting : 0x00bNumEndpoints : 0x00 (Default Control Pipe only)bInterfaceClass : 0x02 (Communications and CDC Control)bInterfaceSubClass : 0x02 (Abstract Control Model)bInterfaceProtocol : 0x01 (AT Commands defined by ITU-T V.250 etc)iInterface : 0x00 (No String Descriptor)Data (HexDump) : 09 04 05 00 00 02 02 01 00 .........
-------------- CDC Interface Descriptor ---------------bFunctionLength : 0x05 (5 bytes)bDescriptorType : 0x24 (Interface)bDescriptorSubType : 0x00 (Header Functional Descriptor)bcdCDC : 0x110 (CDC Version 1.10)Data (HexDump) : 05 24 00 10 01 .$...
-------------- CDC Interface Descriptor ---------------bFunctionLength : 0x05 (5 bytes)bDescriptorType : 0x24 (Interface)bDescriptorSubType : 0x01 (Call Management Functional Descriptor)bmCapabilities : 0x00 D7..2 : 0x00 (Reserved) D1 : 0x00 (sends/receives call management information only over the Communication Class interface) D0 : 0x00 (does not handle call management itself)bDataInterface : 0x01Data (HexDump) : 05 24 01 00 01 .$...
-------------- CDC Interface Descriptor ---------------bFunctionLength : 0x04 (4 bytes)bDescriptorType : 0x24 (Interface)bDescriptorSubType : 0x02 (Abstract Control Management Functional Descriptor)bmCapabilities : 0x02 D7..4 : 0x00 (Reserved) D3 : 0x00 (not supports the notification Network_Connection) D2 : 0x00 (not supports the request Send_Break) D1 : 0x01 (supports the request combination of Set_Line_Coding, Set_Control_Line_State, Get_Line_Coding, and the notification Serial_State) D0 : 0x00 (not supports the request combination of Set_Comm_Feature, Clear_Comm_Feature, and Get_Comm_Feature)Data (HexDump) : 04 24 02 02 .$..
-------------- CDC Interface Descriptor ---------------bFunctionLength : 0x05 (5 bytes)bDescriptorType : 0x24 (Interface)bDescriptorSubType : 0x06 (Union Functional Descriptor)bControlInterface : 0x00bSubordinateInterface[0] : 0x01Data (HexDump) : 05 24 06 00 01 .$...
---------------- Interface Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x04 (Interface Descriptor)bInterfaceNumber : 0x06 (Interface 6)bAlternateSetting : 0x00bNumEndpoints : 0x02 (2 Endpoints)bInterfaceClass : 0x0A (CDC-Data)bInterfaceSubClass : 0x00bInterfaceProtocol : 0x00iInterface : 0x00 (No String Descriptor)Data (HexDump) : 09 04 06 00 02 0A 00 00 00 .........
----------------- Endpoint Descriptor -----------------bLength : 0x07 (7 bytes)bDescriptorType : 0x05 (Endpoint Descriptor)bEndpointAddress : 0x83 (Direction=IN EndpointID=3)bmAttributes : 0x02 (TransferType=Bulk)wMaxPacketSize : 0x0200 (max 512 bytes)bInterval : 0x00 (never NAKs)Data (HexDump) : 07 05 83 02 00 02 00 .......
----------------- Endpoint Descriptor -----------------bLength : 0x07 (7 bytes)bDescriptorType : 0x05 (Endpoint Descriptor)bEndpointAddress : 0x03 (Direction=OUT EndpointID=3)bmAttributes : 0x02 (TransferType=Bulk)wMaxPacketSize : 0x0200 (max 512 bytes)bInterval : 0x00 (never NAKs)Data (HexDump) : 07 05 03 02 00 02 00 .......

四. 枚举过程

见五.抓包文件分享,不再赘述

各设备枚举过程可以参考之前的文章和规格书。

.抓包文件分享

使用bushound抓包枚举过程见文件

UVC+UAC+CDC.txt

链接:https://pan.baidu.com/s/1aDbA72jKDCrlwGNIkSutBg?pwd=wnvf

提取码:wnvf

.总结

以上分享了一个完整的UVC+UAC的扬声器+UAC麦克风+CDC的实例,描述符可以直接使用,其他参考单独的设备的实现即可。USB描述符的正确是能顺利枚举的首要条件,枚举完成了,基本就成功了一半了。有时候描述符一丁点不对就会导致枚举失败,所以有时候这些问题会困扰很久,有一个正确的描述符作为参考显得很有价值。故特分享此案例。


评论 (0)
  • 导读:2025年1月6日,在 ChatGPT 诞生两周年之际,OpenAI 的核心人物 Sam Altman 回顾了一段波澜壮阔且充满挑战的历程。九年前,怀揣着对通用人工智能(AGI)的坚定信念,OpenAI 踏上征程。彼时,质疑声不绝于耳,多数人认为这毫无成功的可能。但他们未曾动摇,毅然投身这一充满未知的领域。直至 2022 年 ChatGPT 的推出,如同在科技领域投入巨石,引发轩然大波,开启了前所未有的发展态势。然而,荣耀背后是难以想象的艰难。围绕新技术构建公司,犹如在黑暗中摸索前行,每一
    用户1739588245528 2025-02-15 11:03 109浏览
  • 文心一言免费对于创业来说是一个很大的机遇,加油!虽然是一个很大的挑战,但是好处还是很大的。文心一言的免费开放为创业者提供了一个低成本甚至零成本使用先进人工智能技术的机会。在以往,创业者若想在项目中融入AI技术,往往需要支付高昂的研发或授权费用。而现在,他们可以直接利用文心一言的强大功能,如语言理解、生成能力、深度搜索等,来构建自己的产品或服务,从而显著降低创业成本。文心一言的全面免费开放为创业者提供了广阔的创新空间。创业者可以基于文心一言开发出各种创新的应用和服务,满足市场的多样化需求。例如,利
    curton 2025-02-14 13:37 281浏览
  • 在设备间通信日益增长的需求中,对于十几米甚至更长距离的高速外设数据传输变得尤为重要。RS-232C接口,凭借其仅需简单的接收、发送及地线配置,以及成本效益高的双绞线连接,凭借其卓越性能,成为了连接通信接口芯片的关键纽带。为了在这种长距离高速通信场景下实现线路的可靠隔离,并有效抵御外部噪声对通信信号的干扰,虽然上一期介绍的晶体管类型输出系列光耦能够满足100kbps速率的隔离传输需求,但面对更高的速率稳定性和性能要求,业界更倾向于采用速率可达300Kbps的KL6N138和KL6N139达林顿高速
    晶台光耦 2025-02-14 13:40 52浏览
  • 电磁铁通电时会产生磁场,磁力随电流增强而增强,表现出吸引铁磁性物质的特性。电磁铁是一种能够产生磁场的装置,其特性在于可以通过通电来控制磁场的产生和消失。那么,当电磁铁通电时,它具体会表现出哪些特性和现象呢?一、产生磁场通电是电磁铁产生磁场的关键。当电流通过电磁铁的线圈时,线圈周围就会产生磁场。这个磁场与电流的大小和方向密切相关,电流越大,产生的磁场也越强。同时,磁场的方向可以通过改变电流的方向来改变,这是电磁铁灵活性的重要体现。二、磁力变化随着电流的增强,电磁铁产生的磁力也会相应增强。这种磁力的
    锦正茂科技 2025-02-15 09:59 96浏览
  • Thiele-Small参数:如何影响扬声器单体设计?想要设计一个高效能的音箱系统,关键在于了解扬声器单体的核心参数,这些参数将直接影响音箱系统的声学表现。而专为扬声器单体所设计的IEC 60268-5 标准便明确规范了扬声器参数的量测方法,让音箱设计者得已透过数据驱动的方式,精确地计算扬声器在不同频率范围内的性能表现,进而设计出符合需求的音箱产品。而这些关键参数,亦即Thiele-Small参数(TS参数),便为设计提供了基础参考数据。案例背景与面临的挑战以本次分享的客户个案为例,该客户是一家
    百佳泰测试实验室 2025-02-14 10:11 52浏览
  • 《哪吒2》票房破百亿背后的科技密码:解码中国动画产业的技术跃迁与制造底气2024年夏季,国产动画电影《哪吒2》以雷霆之势席卷全球院线,不仅成为中国影史第二部票房突破百亿的现象级作品,更以多项技术突破刷新行业纪录。这些成就背后,不仅是中国动画工业的崛起,更是中国科技创新与高端制造业协同突破的缩影。作为深耕PCB行业多年的捷多邦小编,今天带您从技术视角,解读这场银幕奇迹背后的制造密码。一、从“数字造神”到“算力革命”:动画技术背后的硬核突破《哪吒2》的视觉革命始于AI工业化管道的深度应用。影片中大量
    捷多邦 2025-02-15 17:57 400浏览
  •  探针台是半导体测试领域的重要设备,用于支撑和固定待测芯片,以便进行jing确的电气测试。在使用过程中,探针台可能会出现位置偏移,这时就需要进行复位操作。下面,我们将详细介绍探针台复位的zui简单三个步骤。  一、确定复位基准点复位操作的di一步是确定复位基准点。通常,探针台会配备有明确的复位标记或感应点。用户需要仔细查找并确认这些标记,确保复位操作的准确性。找到基准点后,将探针台移动到该位置附近,准备进行下一步操作。二、执行复位动作在确认基准点后,接下来需要执行复
    锦正茂科技 2025-02-15 09:36 81浏览
  • 近日,紫光展锐蜂窝物联网芯片V8850荣获国密一级认证,标志着展锐V8850在安全能力方面获得权威认可,位居行业领先水平。这是紫光展锐继短距物联网芯片V5663在2020获得ARM PSA Level 2认证,蜂窝物联网芯片V8811在2021年获得ARM PSA Level 1 认证后,第三次荣获安全行业权威认证。荣获国密一级安全认证,意味着紫光展锐V8850能支持智能支付、共享经济、定位追踪、安防监控、智能表计、工业DTU、公网对讲,以及车载通信终端设备上的国密升级改造,可为移动支付、短信
    紫光展锐 2025-02-14 19:26 64浏览
  •  芯片设计中的软硬件接口概述作者: Insaf MelianeInsaf Meliane 是 Arteris 的产品管理和营销经理。在加入产品团队之前,她是一名现场应用经理,为客户提供复杂 SoC 设计集成支持。在加入 Arteris 之前,她曾在领先的半导体公司担任过其他设计和应用工程职务。Insaf 拥有法国格勒诺布尔国立高等电子与无线电工程学院微电子专业系统级芯片方面的工程学位。软硬件接口 (HSI) 在芯片设计中扮演着重要角色,用于将物理硬件与其对应软件连接起来。它为复杂的系统
    ArterisIP 2025-02-14 10:28 74浏览
  • 在电路板Layout设计时,有时候会遇到高速差分信号对间或者对内需要交叉走线的情况,这不仅会导致Layout困难,而且交叉走线导致的via增加和绕线也会影响高速信号的信号质量。鉴于这个问题,一些高速差分信号在标准中就定义了其可以对内或者对间交叉连接,而不影响数据对接。现根据标准定义,将各个高速差分信号是否支持对间或对内翻转列出来,供设计参考。注:1. 列出的高速差分信号不全,后续陆续补充;2. 具体使用时,还需要咨询芯片供应商是否支持。USB2.0不支持对间和对内翻转USB3.0支持对内极性翻转
    durid 2025-02-14 08:23 234浏览
  •                           春天来了,我们中国的传统节日--春节到了,随着国家富强,人们民族文化自信心的增强,这个中国年过的还挺热闹,挺红火。一段山村过新年的快乐时光,即兴而发赋了两首新诗。《渔家乐·山村新春》白发垂髫同喜乐,新春佳节意情奢。烟花璀璨腾空起,山村美景醉心涯。晓雾轻笼林野静,晚云淡抹岫峰斜。自然恩赐千般好,福满人间岁月嘉
    广州铁金刚 2025-02-17 15:59 85浏览
  • NoC的下一步发展是什么?作者: Andy NightingaleAndy Nightingale 是 Arteris 产品管理和营销副总裁,拥有超过 37 年的高科技行业经验,其中包括在 Arm 担任各种工程和产品管理职位 23 年。当今的高端 SoC 在很大程度上依赖复杂的片上网络(NoC)技术来实现性能和可扩展性。随着 人工智能(AI)、高性能计算(HPC)和其他计算密集型应用的需求不断发展,设计下一代 SoC 将需要更智能、更高效的 NoC 解决方案来应对这些挑战。尽管这些进步带来了令人
    ArterisIP 2025-02-14 10:16 33浏览
  • 文心一言准备免费,说实话,这个是好事情,但是他也会产生非常大的影响,总体来说,对技术的发展还是起到积极的作用。文心新苑为什么要免费呢?无非就是市场的原因,绝对不是文心一言不想利用这个AI赚钱。我分析下原因:1、市场竞争:在人工智能技术高速发展的背景下,各类AI产品层出不穷,市场竞争日益激烈。尤其是DEEPSEEK的出现,真是的非常重大的一个事件,作为同类产品,文心一言非常无奈的被迫的选择全面免费策略,旨在迅速提高用户量,争夺市场份额。通过免费使用,文心一言能够吸引更多用户,形成网络效应,进而提升
    curton 2025-02-14 10:30 422浏览
  • 随着科技快速进步,蓝牙技术也在持续演化。Bluetooth LE Audio(低功耗蓝牙音讯)因其省电及音质提升等特性,俨然成为目前热门的音讯技术之一。对于经常性使用耳机、手机或笔电的人来说,音频传输的延迟性能不仅影响游戏体验,也同时影响着影音同步与通话质量。然而,由于目前市面上针对LE Audio延迟测试的工具和服务实属不多,厂商在验证设备性能往往面临到技术困难。有鉴于此,百佳泰所提供的专业延迟量测验证服务,可有效协助客户了解产品表现,从而提升市场竞争力!百佳泰技术小词典延迟指的是从声音讯号发
    百佳泰测试实验室 2025-02-14 10:38 76浏览
我要评论
0
0
点击右上角,分享到朋友圈 我知道啦
请使用浏览器分享功能 我知道啦