LayaCCC
LayaCCC

Reputation: 445

What does it means for bDescriptorType is 0x24?

I find a descriptor as below.
As I know, when bDescriptorType is 0x04, it means interface descriptor.
If bDescriptorType is 0x24, what does it means?
I can't find related description in USB spec 2.0.

/*  First Interface Descriptor For Comm Class Interface */
0x09,                  /*  bLength = 9                     */
0x04,                  /*  bDescriptorType = Interface (4) */
0x00,                  /*  bInterfaceNumber                */
0x00,                  /*  bAlternateSetting               */
0x01,                  /*  bNumEndpoints (one for OUT)     */
0x02,                  /*  bInterfaceClass = Communications Interface Class (2) */
0x02,                  /*  bInterfaceSubClass = Abstract Control Model (2) */
0x01,                  /*  bInterfaceProtocol = Common "AT" commands (1), */ 
                      /*   no class specific protocol (0)                */
0x00,                  /*  iInterface                      */

/*  Header Functional Descriptor */

0x05,                  /*  bFunctionalLength = 5           */
0x24,                  /*  bDescriptorType                 */
0x00,                  /*  bDescriptorSubtype              */
0x10, 0x01,            /*  bcdCDC                          */

Upvotes: 6

Views: 7863

Answers (3)

SpaceSoftwares
SpaceSoftwares

Reputation: 11

I suppose this is a better reference for this question , https://cscott.net/usb_dev/data/devclass/usbcdc11.pdf

it is in this document section 5.2.3, Table 24,

The bDescriptorType values are the same ones defined in the USB Device Class Definition for Audio Devices Specification. They were derived by using the DEVICE, CONFIGURATION, STRING, INTERFACE, and ENDPOINT constants defined in chapter 9 of the USB Specification and by setting the class-specific bit defined within the Common Class Specification to generate corresponding class-specific constants. CS_INTERFACE 24h CS_ENDPOINT 25h

And the same table also appears in the zip packed PDF: CDC120-20101103-track.pdf, the full path is (downloaded from the http://www.usb.org) give as follows, CDC1.2_WMC1.1_012011.zip\CDC1.2_WMC1.1_012011\CDC1.2_WMC1.1\usbcdc12\CDC120-20101103-track.pdf

Upvotes: 0

Elmue
Elmue

Reputation: 8148

I find the descriptors 0x24 (CS_INTERFACE) and 0x25 (CS_ENDPOINT) in an interface of class 'Audio' in my iPhone.

I also found some descriptors online: https://discussions.apple.com/thread/6474393

They are named "AC" there (Audio Control). Here only two examples:

AC Input Terminal Descriptor:
------------------------------
0x11    bLength
0x24    bDescriptorType
0x02    bDescriptorSubtype
0x01    bTerminalID
0x0201  wTerminalType   (Microphone)
0x00    bAssocTerminal
0x28    bCSourceID
0x04    bNrChannels
0x00000000 bmChannelConfig
0x16    iChannelNames
0x00    bmControls
0x00    iTerminal


AC Output Terminal Descriptor:
------------------------------
0x0C    bLength
0x24    bDescriptorType
0x03    bDescriptorSubtype
0x14    bTerminalID
0x0301  wTerminalType   (Speaker)
0x00    bAssocTerminal
0x0A    bSourceID
0x28    bCSourceID
0x0000  bmControls
0x00    iTerminal

The functionality of the CS_INTERFACE descriptor depends on the subtype of the descriptor. For example with subtype 02 it is the "AC Input Terminal Descriptor" which allows access to the microfone. And with subtype 03 it is the "AC Output Terminal Descriptor" which allows access to the speaker.

The document CDC 1.20 linked by David Grayson (accepted answer) is not helpful for this type of descriptors.

I found the detailed description in the "USB Device Class Definition for Terminal Types": https://www.usb.org/sites/default/files/termt10.pdf

Upvotes: 1

David Grayson
David Grayson

Reputation: 87446

A value of 0x24 indicates it is a class-specific interface descriptor. Please see the definition of CS_INTERFACE in Table 12 in the CDC 1.20 specification. You can find it here:

http://www.usb.org/developers/docs/devclass_docs/

Please note that 0x24 is usually written as "24h" in these USB standards.

Upvotes: 4

Related Questions