DS4-USB: Difference between revisions
No edit summary |
ShovelTime (talk | contribs) m (Fixed dead link) |
||
Line 234: | Line 234: | ||
=== HID Report Descriptor === | === HID Report Descriptor === | ||
[ | [https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf#page=26 HID Usage Tables 1.12 (p.26)] | ||
{| class="wikitable sortable" | {| class="wikitable sortable" |
Latest revision as of 02:44, 24 March 2024
Source: http://eleccelerator.com/wiki/index.php?title=DualShock_4 (full paste 17:50 UTC, 18 January 2014 )
Source: https://gist.github.com/johndrinkwater/7708901
USB[edit | edit source]
Nonretail consoles can use the ★ Debug Settings : Controller Setting to use USB instead of wireless.
Audio does not carry through USB in the case of a Dual Shock 4.
The reports arrive ~250 times per second (every ~4ms).
Device Descriptor[edit | edit source]
Device Descriptor | ||||
---|---|---|---|---|
Offset | Field | Size | Value | Description |
0 | bLength | 1 | 0x12 | Size of this descriptor in bytes (18) |
1 | bDescriptorType | 1 | 0x01 | DEVICE descriptor type (Constant = 1) |
2 | bcdUSB | 2 | 0x0200 | USB Spec release number (2.00):
with which the device and is descriptors are compliant (e.g.: 0x0200 (USB2.0), 0x0300, (USB3.0)) |
4 | bDeviceClass | 1 | 0x00 | Class code assigned by USB-IF:
(used by the operating system to find a class driver for your device)
|
5 | bDeviceSubClass | 1 | 0x00 | SubClass Code assigned by USB-IF
(used by the operating system to find a class driver for your device) |
6 | bDeviceProtocol | 1 | 0x00 | Protocol Code assigned by USB-IF
(used by the operating system to find a class driver for your device) |
7 | bMaxPacketSize0 | 1 | 0x40 | Max packet size for endpoint 0. (64)
|
8 | idVendor | 2 | 0x054C | Vendor ID (VID) (Sony Corp.)
must be obtained from USB-IF (used by the operating system to find a driver for your device) |
10 | idProduct | 2 | 0x05C4 | Product ID (PID) - (Sony Computer Entertainment Wireless Controller)
assigned by the manufacturer (used by the operating system to find a driver for your device) |
12 | bcdDevice | 2 | 0x0100 | Device release number (Version: 1.00)
in binary coded decimal |
14 | iManufacturer | 1 | 0x01 | Index of string descriptor describing manufacturer
set to 0 if no string |
15 | iProduct | 1 | 0x02 | Index of string descriptor describing product
set to 0 if no string |
16 | iSerialNumber | 1 | 0x00 | Index of string descriptor describing device serial number set to 0 if no string |
17 | bNumConfigurations | 1 | 0x01 | Number of possible configurations |
Configuration Descriptor[edit | edit source]
Configuration Descriptor | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Offset | Field | Size | Value | Description | |||||||
0 | bLength | 1 | 0x09 | Size | |||||||
1 | bDescriptorType | 1 | 0x02 | (= 2) | |||||||
2 | wTotalLength | 2 | 0x0029 | Total number of bytes (41) in this descriptor and all the following descriptors (9+9+9+7+7) | |||||||
4 | bNumInterfaces | 1 | 0x01 | Number of interfaces supported by this configuration | |||||||
5 | bConfigurationValue | 1 | 0x01 | Value used by Set Configuration to select this configuration | |||||||
6 | iConfiguration | 1 | 0x00 | Index of string descriptor describing configuration - set to 0 if no string | |||||||
7 | bmAttributes | 1 | 0xC0 | Self Powered & powered by the bus (11000000) (PS3 controller: 0x80)
specify power parameters for the configuration :
| |||||||
8 | bMaxPower | 1 | 0xFA | Maximum current: 500mA drawn by device in this configuration. In units of 2mA. So 0x32 (50) means 100 mA | |||||||
Interface Descriptor | |||||||||||
0 | bLength | 1 | 0x09 | Size | |||||||
1 | bDescriptorType | 1 | 0x04 | (= 4) | |||||||
2 | bInterfaceNumber | 1 | 0x00 | Number identifying this interface.
Zero-based value | |||||||
3 | bAlternateSetting | 1 | 0x00 | The first (and default) value used to select alternative setting is always 0
(An interface can have more than one variant, and these variants can be switched between, while other interfaces are still in operation) | |||||||
4 | bNumEndpoints | 1 | 0x02 | Number of Endpoints used for this interface | |||||||
5 | bInterfaceClass | 1 | 0x03 | Class code assigned by USB-IF]
| |||||||
6 | bInterfaceSubClass | 1 | 0x00 | SubClass Code assigned by USB-IF | |||||||
7 | bInterfaceProtocol | 1 | 0x00 | Protocol Code assigned by USB-IF | |||||||
8 | iInterface | 1 | 0x00 | Index of string descriptor describing interface - set to 0 if no string | |||||||
Human Interface Device (HID) Descriptor | |||||||||||
0 | bLength | 1 | 0x09 | Size | |||||||
1 | bDescriptorType | 1 | 0x21 | Constant name specifying type of HID descriptor | |||||||
2 | bcdHID 1.17 | 2 | 0x0111 | HID class spec version (1.11) | |||||||
4 | bCountryCode | 1 | 0x00 | Not supported (Device Class Definition for HID 1.11 6.2.1 p33) | |||||||
5 | bNumDescriptors | 1 | 0x01 | Number of Descriptors | |||||||
6 | bDescriptorType | 1 | 0x22 | DescriptorType (34): REPORT | |||||||
7 | DescriptorLength | 2 | 0x01D3 | total size of the Report descriptor (467) | |||||||
Endpoint (IN) Descriptor | |||||||||||
0 | bLength | 1 | 0x07 | Size | |||||||
1 | bDescriptorType | 1 | 0x05 | (= 5) | |||||||
2 | bEndpointAddress | 1 | 0x84 | IN<--(1 000 0100)-->4 (PS3 Controller: 0x81)
The address of this endpoint within the device:
| |||||||
3 | bmAttributes | 1 | 0x03 | Interrupt (00000011)
(D1:0) Transfer Type:
The following only apply to isochronous endpoints. Else set to 0. (D3:2) Synchronisation Type (ISO mode):
(D5:4) Usage Type (ISO mode):
(D7:6) Reserved Set to 0 | |||||||
4 | wMaxPacketSize | 2 | 0x0040 | (64) | |||||||
6 | bInterval | 1 | 0x05 | 5 (unit depends on device speed) (PS3 Controller: 1)
Interval for polling endpoint for data transfers. Expressed in frames (ms) for low/full speed or microframes (125µs) for high speed | |||||||
Endpoint (OUT) Descriptor | |||||||||||
0 | bLength | 1 | 0x07 | Size | |||||||
1 | bDescriptorType | 1 | 0x05 | (= 5) | |||||||
2 | bEndpointAddress | 1 | 0x03 | OUT<--(0 000 0011)-->3 (PS3 Controller: 0x02) | |||||||
3 | bmAttributes | 1 | 0x03 | Interrupt | |||||||
4 | wMaxPacketSize | 2 | 0x0040 | (64) | |||||||
6 | bInterval | 1 | 0x05 | 5 |
HID Report Descriptor[edit | edit source]
Value | Items | Remarks | ||
---|---|---|---|---|
0x05 | 0x01 | - | Usage Page (Generic Desktop Controls) | |
0x09 | 0x05 | - | Usage (Game Pad) | CA – A manual control or cursor device. A game pad minimally consists of a thumb-activated rocker switch that controls two axes (X and Y) and has four buttons. The rocker switch consists of four contact closures for up, down, right, and left. |
0xA1 | 0x01 | - | Collection (Application) | Start |
0x85 | 0x01 | - | Report ID (1) | Used by the FW to determine what data has been send or need to be transmitted |
0x09 | 0x30 | - | Usage (X) | DV – A linear translation in the X direction. Report values should increase as the control’s position is moved from left to right. (for sticks) |
0x09 | 0x31 | - | Usage (Y) | DV – (Y direction- values should increase from far to near) |
0x09 | 0x32 | - | Usage (Z) | DV – (Z direction- values should increase from high to low) |
0x09 | 0x35 | - | Usage (Rz) | DV – A rotation about the Z axis. Angular position report values follow the righthand rule. |
0x15 | 0x00 | - | Logical Minimum (0) | Value for sticks |
0x26 | 0xFF | 0x00 | Logical Maximum (255) | Value |
0x75 | 0x08 | - | Report Size (8) | 8 bits per variable |
0x95 | 0x04 | - | Report Count (4) | 4 variables |
0x81 | 0x02 | - | Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) | send variables (bytes 01 to 04) |
0x09 | 0x39 | - | Usage (Hat switch) | DV – A specialized mechanical configuration of switches generating a variable value with a null state. The switches are arranged around a springloaded knob. When the knob is tilted in the direction of a switch, its contacts are closed. A typical example is four switches that are capable of generating information about four possible directions in which the knob can be tilted. Intermediate positions can also be decoded if the hardware allows two switches to be reported simultaneously. (for D-pad) |
0x15 | 0x00 | - | Logical Minimum (0) | Value (0=N) |
0x25 | 0x07 | - | Logical Maximum (7) | Value (7=NW) |
0x35 | 0x00 | - | Physical Minimum (0) | |
0x46 | 0x3B | 0x01 | Physical Maximum (315) | |
0x65 | 0x14 | - | Unit (System: English Rotation, Length: Centimeter) | |
0x75 | 0x04 | - | Report Size (4) | (4 bits) |
0x95 | 0x01 | - | Report Count (1) | 1 variable (D-pad) |
0x81 | 0x42 | - | Input (Data,Var,Abs,No Wrap,Linear,Preferred State,Null State) | send (byte 05 low nibble -lsb) |
0x65 | 0x00 | - | Unit (None) | |
0x05 | 0x09 | - | Usage Page (Button) | face buttons |
0x19 | 0x01 | - | Usage Minimum (0x01) | first button |
0x29 | 0x0E | - | Usage Maximum (0x0E) | last button (14) |
0x15 | 0x00 | - | Logical Minimum (0) | Value for each button (status: 0 or 1) |
0x25 | 0x01 | - | Logical Maximum (1) | |
0x75 | 0x01 | - | Report Size (1) | 1 bit per button |
0x95 | 0x0E | - | Report Count (14) | 14 bits |
0x81 | 0x02 | - | Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) | send (byte 05 high nibble msb, 8 bits of byte 06 and binary bit 0 & 1 of byte 07) |
0x06 | 0x00 | 0xFF | Usage Page (Vendor Defined 0xFF00) | |
0x09 | 0x20 | - | Usage (0x20) | Counter |
0x75 | 0x06 | - | Report Size (6) | 6 bits |
0x95 | 0x01 | - | Report Count (1) | |
0x15 | 0x00 | - | Logical Minimum (0) | |
0x25 | 0x7F | - | Logical Maximum (127) | Note: REPORT_SIZE (6) is too small for LOGICAL_MAXIMUM (127) which needs 7 bits |
0x81 | 0x02 | - | Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) | send (byte 07: msb 6 bits) |
0x05 | 0x01 | - | Usage Page (Generic Desktop Controls) | Shoulderpads Trigger |
0x09 | 0x33 | - | Usage (Rx) | DV – A rotation about the X axis. Angular position report values follow the right hand rule (L2 trigger) |
0x09 | 0x34 | - | Usage (Ry) | DV – A rotation about the Z axis. Angular position report values follow the right hand rule (R2 trigger) |
0x15 | 0x00 | - | Logical Minimum (0) | |
0x26 | 0xFF | 0x00 | Logical Maximum (255) | |
0x75 | 0x08 | - | Report Size (8) | 8 bits |
0x95 | 0x02 | - | Report Count (2) | 2 bytes |
0x81 | 0x02 | - | Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) | send bytes 08 & 09 |
0x06 | 0x00 | 0xFF | Usage Page (Vendor Defined 0xFF00) | |
0x09 | 0x21 | - | Usage (0x21) | |
0x95 | 0x36 | - | Report Count (54) | |
0x81 | 0x02 | - | Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) | |
0x85 | 0x05 | - | Report ID (5) | |
0x09 | 0x22 | - | Usage (0x22) | |
0x95 | 0x1F | - | Report Count (31) | |
0x91 | 0x02 | - | Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0x04 | - | Report ID (4) | |
0x09 | 0x23 | - | Usage (0x23) | |
0x95 | 0x24 | - | Report Count (36) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | DV – declared in an Input report and is used as a notification to the host that the contents of a specific Feature report has changed |
0x85 | 0x02 | - | Report ID (2) | |
0x09 | 0x24 | - | Usage (0x24) | |
0x95 | 0x24 | - | Report Count (36) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0x08 | - | Report ID (8) | |
0x09 | 0x25 | - | Usage (0x25) | |
0x95 | 0x03 | - | Report Count (3) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0x10 | - | Report ID (16) | |
0x09 | 0x26 | - | Usage (0x26) | |
0x95 | 0x04 | - | Report Count (4) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0x11 | - | Report ID (17) | |
0x09 | 0x27 | - | Usage (0x27) | |
0x95 | 0x02 | - | Report Count (2) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0x12 | - | Report ID (18) | |
0x06 | 0x02 | 0xFF | Usage Page (Vendor Defined 0xFF02) | |
0x09 | 0x21 | - | Usage (0x21) | |
0x95 | 0x0F | - | Report Count (15) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0x13 | - | Report ID (19) | |
0x09 | 0x22 | - | Usage (0x22) | |
0x95 | 0x16 | - | Report Count (22) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0x14 | - | Report ID (20) | |
0x06 | 0x05 | 0xFF | Usage Page (Vendor Defined 0xFF05) | |
0x09 | 0x20 | - | Usage (0x20) | |
0x95 | 0x10 | - | Report Count (16) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0x15 | - | Report ID (21) | |
0x09 | 0x21 | - | Usage (0x21) | |
0x95 | 0x2C | - | Report Count (44) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x06 | 0x80 | 0xFF | Usage Page (Vendor Defined 0xFF80) | |
0x85 | 0x80 | - | Report ID (128) | |
0x09 | 0x20 | - | Usage (0x20) | |
0x95 | 0x06 | - | Report Count (6) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0x81 | - | Report ID (129) | |
0x09 | 0x21 | - | Usage (0x21) | |
0x95 | 0x06 | - | Report Count (6) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0x82 | - | Report ID (130) | |
0x09 | 0x22 | - | Usage (0x22) | |
0x95 | 0x05 | - | Report Count (5) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0x83 | - | Report ID (131) | |
0x09 | 0x23 | - | Usage (0x23) | |
0x95 | 0x01 | - | Report Count (1) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0x84 | - | Report ID (132) | |
0x09 | 0x24 | - | Usage (0x24) | |
0x95 | 0x04 | - | Report Count (4) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0x85 | - | Report ID (133) | |
0x09 | 0x25 | - | Usage (0x25) | |
0x95 | 0x06 | - | Report Count (6) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0x86 | - | Report ID (134) | |
0x09 | 0x26 | - | Usage (0x26) | |
0x95 | 0x06 | - | Report Count (6) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0x87 | - | Report ID (135) | |
0x09 | 0x27 | - | Usage (0x27) | |
0x95 | 0x23 | - | Report Count (35) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0x88 | - | Report ID (136) | |
0x09 | 0x28 | - | Usage (0x28) | |
0x95 | 0x22 | - | Report Count (34) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0x89 | - | Report ID (137) | |
0x09 | 0x29 | - | Usage (0x29) | |
0x95 | 0x02 | - | Report Count (2) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0x90 | - | Report ID (144) | |
0x09 | 0x30 | - | Usage (X) | DV – A linear translation in the X direction. Report values should increase as the control’s position is moved from left to right. |
0x95 | 0x05 | - | Report Count (5) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0x91 | - | Report ID (145) | |
0x09 | 0x31 | - | Usage (Y) | DV – A linear translation in the Y direction. Report values should increase as the control’s position is moved from far to near. |
0x95 | 0x03 | - | Report Count (3) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0x92 | - | Report ID (146) | |
0x09 | 0x32 | - | Usage (Z) | DV – A linear translation in the Z direction. Report values should increase as the control’s position is moved from high to low (Z). |
0x95 | 0x03 | - | Report Count (3) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0x93 | - | Report ID (147) | |
0x09 | 0x33 | - | Usage (Rx) | DV – A rotation about the X axis. Angular position report values follow the righthand rule. |
0x95 | 0x0C | - | Report Count (12) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0xA0 | - | Report ID (160) | |
0x09 | 0x40 | - | Usage (Vx) | DV – A vector in the X direction. Report values should increase as the vector increases in the positive X direction (from left to right). Negative values represent vectors in the negative X direction. |
0x95 | 0x06 | - | Report Count (6) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0xA1 | - | Report ID (161) | |
0x09 | 0x41 | - | Usage (Vy) | DV – A vector in the Y direction. Report values should increase as the vector increases in the positive Y direction (from far to near). Negative values represent vectors in the negative Y direction. |
0x95 | 0x01 | - | Report Count (1) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0xA2 | - | Report ID (162) | |
0x09 | 0x42 | - | Usage (Vz) | DV – (Z direction -from high to low) |
0x95 | 0x01 | - | Report Count (1) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0xA3 | - | Report ID (163) | |
0x09 | 0x43 | - | Usage (Vbrx) | DV – A vector in the X direction relative to the body of an object. Report values should increase as the vector increases in the positive X direction (forward). Negative values represent vectors in the negative X direction. X is the “forward” axis for an object |
0x95 | 0x30 | - | Report Count (48) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0xA4 | - | Report ID (164) | |
0x09 | 0x44 | - | Usage (Vbry) | DV – (Y direction -to the right from an observer facing forward on the object) |
0x95 | 0x0D | - | Report Count (13) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0xA5 | - | Report ID (165) | |
0x09 | 0x45 | - | Usage (Vbrz) | DV – A vector in the Z direction relative to the body of an object. Report values should increase as the vector increases in the positive Z direction (down from an observer facing forward on the object). Negative values represent vectors in the negative Z direction. |
0x95 | 0x15 | - | Report Count (21) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0xA6 | - | Report ID (166) | |
0x09 | 0x46 | - | Usage (Vno) | DV– A non oriented vector or value. The units define a physical measurement not related to a specific axis or orientation. An example would be pressure or temperature. |
0x95 | 0x15 | - | Report Count (21) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0xF0 | - | Report ID (240) | |
0x09 | 0x47 | - | Usage (Feature Notification) | |
0x95 | 0x3F | - | Report Count (63) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0xF1 | - | Report ID (241) | |
0x09 | 0x48 | - | Usage (Resolution Multiplier) | DV– Defines a (if a device has the capability to vary the resolution of one or more of its controls) Resolution Multiplier for a (all) Control: |
0x95 | 0x3F | - | Report Count (63) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0xF2 | - | Report ID (242) | |
0x09 | 0x49 | - | Usage (0x49) | |
0x95 | 0x0F | - | Report Count (15) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0xA7 | - | Report ID (167) | |
0x09 | 0x4A | - | Usage (0x4A) | |
0x95 | 0x01 | - | Report Count (1) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0xA8 | - | Report ID (168) | |
0x09 | 0x4B | - | Usage (0x4B) | |
0x95 | 0x01 | - | Report Count (1) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0xA9 | - | Report ID (169) | |
0x09 | 0x4C | - | Usage (0x4C) | |
0x95 | 0x08 | - | Report Count (8) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0xAA | - | Report ID (170) | |
0x09 | 0x4E | - | Usage (0x4E) | |
0x95 | 0x01 | - | Report Count (1) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0xAB | - | Report ID (171) | |
0x09 | 0x4F | - | Usage (0x4F) | |
0x95 | 0x39 | - | Report Count (57) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0xAC | - | Report ID (172) | |
0x09 | 0x50 | - | Usage (0x50) | |
0x95 | 0x39 | - | Report Count (57) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0xAD | - | Report ID (173) | |
0x09 | 0x51 | - | Usage (0x51) | |
0x95 | 0x0B | - | Report Count (11) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0xAE | - | Report ID (174) | |
0x09 | 0x52 | - | Usage (0x52) | |
0x95 | 0x01 | - | Report Count (1) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0xAF | - | Report ID (175) | |
0x09 | 0x53 | - | Usage (0x53) | |
0x95 | 0x02 | - | Report Count (2) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0x85 | 0xB0 | - | Report ID (176) | |
0x09 | 0x54 | - | Usage (0x54) | |
0x95 | 0x3F | - | Report Count (63) | |
0xB1 | 0x02 | - | Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) | |
0xC0 | - | - | End Collection | End |
Total size of the Report descriptor is 0x01D3 (467)
Report Structure[edit | edit source]
Samples Report[edit | edit source]
64 bytes
| |||||
Offset(d) 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 00000000 01 81 80 83 7A 08 00 00 00 00 93 5F FB D2 FF DA 00000016 FF D8 FF 4F EE 14 1B 99 FE 00 00 00 00 00 05 00 00000032 00 00 00 80 00 00 00 80 00 00 00 00 80 00 00 00 00000048 80 00 00 00 00 80 00 00 00 80 00 00 00 00 80 00 |
Offset(d) 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 00000000 01 7d 80 7f 80 08 00 f0 00 00 98 5b fd 07 00 57 00000016 00 9b fe 8d 0d 1b 1f 6d 05 00 00 00 00 00 1b 00 00000032 00 01 2b a9 b8 41 16 ab 86 e5 12 00 80 00 00 00 00000048 80 00 00 00 00 80 00 00 00 80 00 00 00 00 80 00
Offset(d) 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 00000000 01 7e 82 7f 7e 08 00 30 00 00 89 96 fc 00 00 00 00000016 00 03 00 a9 00 af 20 e9 07 00 00 00 00 00 1b 00 00000032 00 01 2c 72 8a 40 28 73 1f 04 0e 00 80 00 00 00 00000048 80 00 00 00 00 80 00 00 00 80 00 00 00 00 80 00
Offset(d) 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 00000000 01 7e 81 7f 7e 08 00 bc 00 00 17 a1 fd fd ff 01 00000016 00 01 00 8d 00 a3 20 d1 07 00 00 00 00 00 1b 00 00000032 00 02 3c 0b 5b 94 1a 87 de c0 1b 41 0b 5e 94 1a 00000048 87 de c0 1b 00 80 00 00 00 80 00 00 00 00 80 00
Data Format[edit | edit source]
byte index | bit 7 | bit 6 | bit 5 | bit 4 | bit 3 | bit 2 | bit 1 | bit 0 | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
[0] | Report ID (USB) | |||||||||||||||||||||||||||||||||||||||
[1] | Left stick axis X (0: left) | |||||||||||||||||||||||||||||||||||||||
[2] | Left Stick axis Y (0: up) | |||||||||||||||||||||||||||||||||||||||
[3] | Right Stick axis X (0: left) | |||||||||||||||||||||||||||||||||||||||
[4] | Right Stick axis Y (0: up) | |||||||||||||||||||||||||||||||||||||||
[5] | D-PAD : hat format (0x08 is released)
| |||||||||||||||||||||||||||||||||||||||
[6] | (8) | (4) | (2) | (1) | ||||||||||||||||||||||||||||||||||||
[7] | Counter (counts up by 1 per report) | T-PAD click (2) | (1) | |||||||||||||||||||||||||||||||||||||
[8] | Trigger (0 = released/unpressed, 0xFF = fully pressed) | |||||||||||||||||||||||||||||||||||||||
[9] | Trigger | |||||||||||||||||||||||||||||||||||||||
[10 - 11] | Seems to be a timestamp. A common increment value between two reports is 188 (at full rate the report period is 1.25ms). This timestamp is used by the PS4 to process acceleration and gyroscope data. | |||||||||||||||||||||||||||||||||||||||
[12] | Battery Level | |||||||||||||||||||||||||||||||||||||||
[13 - 14] | Gyro X: angular velocity measures (follows right-hand-rule) | |||||||||||||||||||||||||||||||||||||||
[15 - 16] | Gyro Y | |||||||||||||||||||||||||||||||||||||||
[17 - 18] | Gyro Z | |||||||||||||||||||||||||||||||||||||||
[19 - 20] | Accel X (signed): acceleration (positive: right) | |||||||||||||||||||||||||||||||||||||||
[21 - 22] | Accel Y (signed): acceleration (positive: up) | |||||||||||||||||||||||||||||||||||||||
[23 - 24] | Accel Z (signed): acceleration (positive: towards player) | |||||||||||||||||||||||||||||||||||||||
[25 - 29] | Unknown | |||||||||||||||||||||||||||||||||||||||
[30] | EXT/HeadSet/Earset: bitmask
| |||||||||||||||||||||||||||||||||||||||
[31 - 32] | Unknown: speculation: theses 5 next (reserved) nibbles for future additional products | |||||||||||||||||||||||||||||||||||||||
[33] | Unknown: speculation: could be bitmaps for control commands like volume, etc. | T-PAD event active:
(seen only)
| ||||||||||||||||||||||||||||||||||||||
[34] | T-PAD: auto incrementing number to track last update? | |||||||||||||||||||||||||||||||||||||||
[35] | 0 if finger №1 is down. | T-PAD: tracking numbers, unique to each finger (№1) down, so for each lift and repress, it gets a newly incremented figure. | ||||||||||||||||||||||||||||||||||||||
[36 - 38] | T-PAD: each finger (№1) location/positional data: static upon finger lifting, to maintain state.
To decode, each coordinated (x & y) is using 12 bits, you need to mask/split and swap the middle byte : e.g: 0x8a 4|0 28 → 0x08a 284 → x= 138 y= 644 [2] | |||||||||||||||||||||||||||||||||||||||
[39] | 0 if finger №2 is down. | T-PAD: tracking numbers, unique to each finger (№2) down. | ||||||||||||||||||||||||||||||||||||||
[40 - 42] | T-PAD: each finger (№2) location. | |||||||||||||||||||||||||||||||||||||||
[44 - 47] | T-PAD: the previous touches (№1) track and location | |||||||||||||||||||||||||||||||||||||||
[48 - 51] | T-PAD: the previous touches (№2) track and location | |||||||||||||||||||||||||||||||||||||||
[52 - 63] | TODO[3] |
Notes[edit | edit source]
see Button mapping
Speculation: sound, rumble (active: 1-255 / Left-Right small or large?) and LED (Color changing 8 bits for each of the R, G, and B primaries : 13-255?) are only carry through (always enable) blue-tooth.
Class Requests[edit | edit source]
This is what happened with a controller that was not previously synced to the PS4
Set Address Get Device Descriptor: (Short Device Descriptor) Get Device Descriptor: (Full Device Descriptor) Get String Descriptor[idx=0, langID=0]: 04 03 Get String Descriptor[idx=0, langID=0]: 04 03 09 04 Get String Descriptor[idx=1, langID=0x0409]: 38 03 Get String Descriptor[idx=1, langID=0x0409]: "Sony Computer Entertainment" Get String Descriptor[idx=2, langID=0x0409]: Get String Descriptor[idx=3, langID=0x0409]: "Wireless Controller" Get Configuration Descriptor: (Short Configuration Descriptor) Get Configuration Descriptor: (Full Configuration Descriptor) Get Device Status: 00 00 Set Configuration to 0x01 Get Descriptor: (HID Report Descriptor) Set Idle to 0 Get Report 0xA3: A3 41 75 67 20 20 33 20 32 30 31 33 00 00 00 00 00 30 37 3A 30 31 3A 31 32 00 00 00 00 00 00 00 00 00 01 00 31 03 00 00 00 49 00 05 00 00 80 03 00 Get Report 0x02: 02 01 00 00 00 00 00 87 22 7B DD B2 22 47 DD BD 22 43 DD 1C 02 1C 02 7F 1E 2E DF 60 1F 4C E0 3A 1D C6 DE 08 00 Get Report 0xA3: A3 41 75 67 20 20 33 20 32 30 31 33 00 00 00 00 00 30 37 3A 30 31 3A 31 32 00 00 00 00 00 00 00 00 00 01 00 31 03 00 00 00 49 00 05 00 00 80 03 00 Get Report 0x12: 12 8B 09 07 6D 66 1C 08 25 00 00 00 00 00 00 00 Set Report 0x14: 13 AC 9E 17 94 05 B0 56 E8 81 38 08 06 51 41 C0 7F 12 AA D9 66 3C CE Set Report 0x12: 14 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
The same controller is then disconnected, and this is what happened when it reconnected
... enumeration steps same as before Get Report 0xA3: A3 41 75 67 20 20 33 20 32 30 31 33 00 00 00 00 00 30 37 3A 30 31 3A 31 32 00 00 00 00 00 00 00 00 00 01 00 31 03 00 00 00 49 00 05 00 00 80 03 00 Get Report 0x02: 02 01 00 00 00 00 00 87 22 7B DD B2 22 47 DD BD 22 43 DD 1C 02 1C 02 7F 1E 2E DF 60 1F 4C E0 3A 1D C6 DE 08 00 Get Report 0xA3: A3 41 75 67 20 20 33 20 32 30 31 33 00 00 00 00 00 30 37 3A 30 31 3A 31 32 00 00 00 00 00 00 00 00 00 01 00 31 03 00 00 00 49 00 05 00 00 80 03 00 Get Report 0x12: 12 8B 09 07 6D 66 1C 08 25 00 AC 9E 17 94 05 B0
report ID 0xA3 seems to be some sort of time-of-manufacture identifier, it contains a date and time as a string in the beginning, ".Aug 3 2013.....07:01:12...........1....I....."
AC 9E 17 94 05 B0 is PS4 (Host) Bluetooth MAC Address (in proper MAC format, it is B0:05:94:17:9E:AC), AC 9E 17 is the LAP and 0x94 is the UAP, 05 B0 is the NAP, this was verified using a Bluetooth sniffer.
The 16 bytes that follow immediately after the BD_ADDR is the link key that is used to authenticate the DualShock 4. When a Bluetooth connection is established, this link key is used for authentication.
I am guessing that 8B 09 07 6D 66 1C means something, it's different on a different controller, it seems to be the Bluetooth MAC Address of the DualShock 4. in proper MAC format it is 1C:66:6D:07:09:8B in this example.
|