Skip to content

Instantly share code, notes, and snippets.

@zerowidth
Last active October 18, 2015 04:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zerowidth/685dbf163f3e2cf5c56b to your computer and use it in GitHub Desktop.
Save zerowidth/685dbf163f3e2cf5c56b to your computer and use it in GitHub Desktop.
usbconfig output for apple keyboard
# usbconfig -u 3 -a 3 dump_device_desc
ugen3.3: <Apple Keyboard Apple, Inc> at usbus3, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (20mA)
bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0200
bDeviceClass = 0x0000
bDeviceSubClass = 0x0000
bDeviceProtocol = 0x0000
bMaxPacketSize0 = 0x0008
idVendor = 0x05ac
idProduct = 0x0220
bcdDevice = 0x0069
iManufacturer = 0x0001 <Apple, Inc>
iProduct = 0x0002 <Apple Keyboard>
iSerialNumber = 0x0000 <no string>
bNumConfigurations = 0x0001
# usbconfig -u 3 -a 3 dump_curr_config_desc
ugen3.3: <Apple Keyboard Apple, Inc> at usbus3, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (20mA)
Configuration index 0
bLength = 0x0009
bDescriptorType = 0x0002
wTotalLength = 0x003b
bNumInterfaces = 0x0002
bConfigurationValue = 0x0001
iConfiguration = 0x0000 <no string>
bmAttributes = 0x00a0
bMaxPower = 0x000a
Interface 0
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0000
bAlternateSetting = 0x0000
bNumEndpoints = 0x0001
bInterfaceClass = 0x0003
bInterfaceSubClass = 0x0001
bInterfaceProtocol = 0x0001
iInterface = 0x0000 <no string>
Additional Descriptor
bLength = 0x09
bDescriptorType = 0x21
bDescriptorSubType = 0x11
RAW dump:
0x00 | 0x09, 0x21, 0x11, 0x01, 0x21, 0x01, 0x22, 0x4b,
0x08 | 0x00
Endpoint 0
bLength = 0x0007
bDescriptorType = 0x0005
bEndpointAddress = 0x0081 <IN>
bmAttributes = 0x0003 <INTERRUPT>
wMaxPacketSize = 0x0008
bInterval = 0x000a
bRefresh = 0x0000
bSynchAddress = 0x0000
Interface 1
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0001
bAlternateSetting = 0x0000
bNumEndpoints = 0x0001
bInterfaceClass = 0x0003
bInterfaceSubClass = 0x0000
bInterfaceProtocol = 0x0000
iInterface = 0x0000 <no string>
Additional Descriptor
bLength = 0x09
bDescriptorType = 0x21
bDescriptorSubType = 0x11
RAW dump:
0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0x2f,
0x08 | 0x00
Endpoint 0
bLength = 0x0007
bDescriptorType = 0x0005
bEndpointAddress = 0x0082 <IN>
bmAttributes = 0x0003 <INTERRUPT>
wMaxPacketSize = 0x0001
bInterval = 0x000a
bRefresh = 0x0000
bSynchAddress = 0x0000
# from the usbconfig manpage:
# Dump HID descriptor for device on USB bus 1 at address 2:
# usbconfig -u 1 -a 2 do_request 0x81 0x06 0x2200 0 0x100
# usbconfig -u 3 -a 3 do_request 0x81 0x06 0x2200 0 0x100
REQUEST = <0x05 0x01 0x09 0x06 0xa1 0x01 0x05 0x07 0x19 0xe0 0x29 0xe7 0x15 0x00 0x25 0x01 0x75 0x01 0x95 0x08 0x81 0x02 0x95 0x01 0x75 0x08 0x81 0x01 0x05 0x08 0x19 0x01 0x29 0x05 0x95 0x05 0x75 0x01 0x91 0x02 0x95 0x01 0x75 0x03 0x91 0x01 0x05 0x07 0x19 0x00 0x2a 0xff 0x00 0x95 0x05 0x75 0x08 0x15 0x00 0x26 0xff 0x00 0x81 0x00 0x05 0xff 0x09 0x03 0x75 0x08 0x95 0x01 0x81 0x02 0xc0><)%uu)uu*u&u>
# decoded with http://eleccelerator.com/usbdescreqparser/
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x09, 0x06, // Usage (Keyboard)
0xA1, 0x01, // Collection (Application)
0x05, 0x07, // Usage Page (Kbrd/Keypad)
0x19, 0xE0, // Usage Minimum (0xE0)
0x29, 0xE7, // Usage Maximum (0xE7)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x75, 0x01, // Report Size (1)
0x95, 0x08, // Report Count (8)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x95, 0x01, // Report Count (1)
0x75, 0x08, // Report Size (8)
0x81, 0x01, // Input (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x08, // Usage Page (LEDs)
0x19, 0x01, // Usage Minimum (Num Lock)
0x29, 0x05, // Usage Maximum (Kana)
0x95, 0x05, // Report Count (5)
0x75, 0x01, // Report Size (1)
0x91, 0x02, // Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0x95, 0x01, // Report Count (1)
0x75, 0x03, // Report Size (3)
0x91, 0x01, // Output (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0x05, 0x07, // Usage Page (Kbrd/Keypad)
0x19, 0x00, // Usage Minimum (0x00)
0x2A, 0xFF, 0x00, // Usage Maximum (0xFF)
0x95, 0x05, // Report Count (5)
0x75, 0x08, // Report Size (8)
0x15, 0x00, // Logical Minimum (0)
0x26, 0xFF, 0x00, // Logical Maximum (255)
0x81, 0x00, // Input (Data,Array,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0xFF, // Usage Page (Reserved 0xFF)
0x09, 0x03, // Usage (0x03)
0x75, 0x08, // Report Size (8)
0x95, 0x01, // Report Count (1)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0, // End Collection
// 75 bytes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment