wire / wire-format / usb-descriptor
A USB device descriptor is the first descriptor retrieved by the host during enumeration. It describes the device's USB version, class, subclass, protocol, max packet size, vendor/product IDs, and number of configurations. The descriptor is 18 bytes: bLength (1), bDescriptorType (1, = 0x01 for device), bcdUSB (2), bDeviceClass (1), bDeviceSubClass (1), bDeviceProtocol (1), bMaxPacketSize0 (1), idVendor (2), idProduct (2), bcdDevice (2), iManufacturer (1), iProduct (1), iSerialNumber (1), bNumConfigurations (1).
aka: USB device descriptor
spec: USB 2.0 specification
A USB device descriptor is the first descriptor retrieved by the host during enumeration. It describes the device's USB version, class, subclass, protocol, max packet size, vendor/product IDs, and number of configurations. The descriptor is 18 bytes: bLength (1), bDescriptorType (1, = 0x01 for device), bcdUSB (2), bDeviceClass (1), bDeviceSubClass (1), bDeviceProtocol (1), bMaxPacketSize0 (1), idVendor (2), idProduct (2), bcdDevice (2), iManufacturer (1), iProduct (1), iSerialNumber (1), bNumConfigurations (1).
| field | size | meaning |
|---|---|---|
| bLength | 1 byte | Size of this descriptor (18). |
| bDescriptorType | 1 byte | 0x01 (DEVICE). |
| bcdUSB | 2 bytes (BCD) | USB specification version (e.g. 0x0200 for USB 2.0, 0x0300 for USB 3.0, 0x0310 for USB 3.1). |
| bDeviceClass | 1 byte | Device class (0 = use interface descriptors, 0x02 = CDC, 0x03 = HID, 0x08 = Mass Storage, 0x09 = Hub, 0x0E = Video, 0xE0 = Wireless, 0xEF = Miscellaneous). |
| bDeviceSubClass | 1 byte | Subclass (class-specific). |
| bDeviceProtocol | 1 byte | Protocol (class-specific). |
| bMaxPacketSize0 | 1 byte | Max packet size for endpoint 0 (8, 16, 32, or 64 for USB 2.0; 9 for USB 3.0). |
| idVendor | 2 bytes | Vendor ID (assigned by USB-IF). |
| idProduct | 2 bytes | Product ID (assigned by vendor). |
| bcdDevice | 2 bytes (BCD) | Device release number. |
| iManufacturer | 1 byte | Index of manufacturer string descriptor (0 = none). |
| iProduct | 1 byte | Index of product string descriptor. |
| iSerialNumber | 1 byte | Index of serial number string descriptor. |
| bNumConfigurations | 1 byte | Number of possible configurations. |
example:
12 01 00 02 00 00 00 40 00 00 00 00 00 00 00 00 00 01
USB device descriptor: 18 bytes, USB 2.0, max packet 64, 1 configuration
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/usb-descriptor
or /wire-format/usb-descriptor.json