TADA, it’s `hexdump -v -e '64/1 "%02x" "\n"' < /dev/hidraw3`
No idea what the first byte is… but I’m going to assume its for device ID for the many users that are connected, but it probably has to be set by the connected machine?
left stick, value, first field is horz (00 left), second field is vertical (00 top)
right stick, value, first field is horz (00 left), second field is vertical (00 top)
face buttons, bitmask, right side: 0 unpress, 1 for square, 2 for X, 4 for circle, 8 for triangle, combinations up to f
face buttons, value, left side: 8 for no value, 0 for up, 1 for topright, 2 for right and it continues clockwise until 7 for topleft
face buttons, bitmask, 0 unpressed, L3/R3 aka analog stick click ins, 1 for share, 2 for options, 4 for L3, 8 for R3,
triggers, bitmask, 0 unpressed, 1 for L1, 2 for R2, 4 for L2, 8 for R2
event, 6 bits, incremented once each query, to track updates
face button, bitmask, last 2 bits of this field, 1 for PS button, 2 for trackpad click // thanks to @evilhackerdude
triggers, value, first is L2 (00 unpressed), second is R2 (00 unpressed)
UNKNOWN time from gyro? ever incrementing, byteorder swapped.
this data is bothering me atm…
battery level, 00 to ff
Relative gyro motion, byteorderswapped, pitch, yaw, roll
Absolute gyro, byteorderswapped, roll, yaw, pitch. 0 for pitch is horizon
Still debating the values and labelling here. Certainly absolute, might have naming muddled.
Unknown! We still have to find LED colour and active rumble output, so I expect these here.
Appears to be EXT info, bitmask, 00011011 is nothing attached. 01111011 is headset with mic. 00111011 is headphones.
Unknown! I expect, but cannot confirm until Sony releases additional products, that the 5 nibbles next are bitmaps for control
commands like volume, etc.
Touches are: 1 bit of event active, 7 bits of event id, followed by 3 bytes of positional data.
Supports 2 active touches, 2 previous touches. Remaining data is unset (for all I can see)
Says how many packets to read, only seen 01 or 02 set
A packet contains two touch events, touches can be ‘null’ by being 80000000
This appears to be another auto incrementing number to track last update, but need to do research…
these values are tracking numbers, unique to each finger down, so for each lift and repress, it gets a newly incremented figure
these values are for each fingers’ location, they stay static upon finger lifting, to maintain state. Not sure how it tracks if user is still holding, yet…
To decode, each coord is using 12 bits… you need to mask/split and swap the middle byte
01401D → 0001 468
604738 → 1888 900
Basically this, but written well :^)
short finger1x = ((buf & 0x0F) << 8) | buf;
short finger1y = buf << 4 | (buf>>4);
as finger moves over the touchpad, a duplicate motion (likely previous position?) is sent, for both fingers, even if just one is moving
Things I still haven’t discovered: LED status/colour, active rumble status, confirmation of gyro labelling
Audio is dealt with using Bluetooth’s headset spec; haven’t been able to confirm if this is exposed at all over USB, or if it
is meant to trigger automatic Bluetooth pairing and audio connection.