Skip to content

Latest commit

 

History

History
1400 lines (1317 loc) · 28.1 KB

File metadata and controls

1400 lines (1317 loc) · 28.1 KB

Controller protocol v1

Used in win 3, win max 2, win mini 23/24 and win 4.

Device info

Product ID: 0x2f24
Vendor ID:  0x135

Report descriptor:

Usage Page (FF00h),         ; FF00h, vendor-defined
Usage (01h),
Collection (Application),
    Report ID (1),
    Usage Minimum (01h),
    Usage Maximum (02h),
    Logical Minimum (0),
    Logical Maximum (255),
    Report Size (8),
    Report Count (32),
    Input (Variable),
    Usage Minimum (01h),
    Usage Maximum (02h),
    Logical Minimum (0),
    Logical Maximum (255),
    Report Count (32),
    Output (Variable),
End Collection

Key codes

Keyboard mode uses HID Usage ID key codes and a few custom special codes.

Custom key codes for keyboard mode:

0xe8 - mousewheel up
0xe9 - mousewheel down
0xea - left mouse
0xeb - right mouse
0xec - middle mouse
0xed - mouse fast move

Custom key codes for gamepad mode:

0x8000 - dpad up
0x8001 - dpad down
0x8002 - dpad left
0x8003 - dpad right
0x8004 - start
0x8005 - select
0x8006 - menu
0x8007 - button A
0x8008 - button B
0x8009 - button X
0x800a - button Y
0x800b - L1
0x800c - R1
0x800d - L2
0x800e - R2
0x800f - L3
0x8010 - R3
0x8011 - left stick up
0x8012 - left stick down
0x8013 - left stick left
0x8014 - left stick right
0x8015 - right stick up
0x8016 - right stick down
0x8017 - right stick left
0x8018 - right stick right

Commands

Mode:

  • Read (1)
  • Write (2)

Command:

  • controller version/init communication (0)
  • Read/Write (1)
  • Checksum (2)
  • Commit (3)

Supported combinations, and their effect, below.

Packets

Init communication

Send

0 1 2 3 4 5-31
ID const mode cmd const ^ 0xff mode ^ 0xf cmd ^ 0xf
01 a5 01 00 5a 0e 0f 00

Response

0 1 2 3 4 5-7 8 9 10 11 12 13-63
ID const mode cmd const ^ 0xff mode ^ 0xff cmd ^ 0xff ready state xinput version minor xinput version major keyboard&mouse version minor keyboard&mouse version major other bytes
01 a5 01 00 5a 0e 0f 00 xx xx xx xx xx xx

Successful initialization returns 0xaa in byte 8.

Get current config

Send

0 1 2 3 4 5 6 7-31
ID const mode cmd const ^ 0xff mode ^ 0xf cmd ^ 0xf page index
01 a5 01 01 5a 0e 0e 00 00 00

Response

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42-49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
dpad up dpad down dpad left dpad right A B X Y left analog up left analog down left analog left left analog right L3 R3 Start Select Menu L1 R1 L2 R2 left back button slot 1 left back button slot 2 left back button slot 3 left back button slot 4 right back button slot 1 right back button slot 2 right back button slot 3
xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx 00 xx xx xx xx xx xx xx xx xx xx xx xx xx xx

Sample response using hidapi:

1b00 1900 0600 0500 5100 4f00 5000 5200 1a00 1600 0400 0700 2c00 2800 0d00 1200 2900 ea00 eb00 1300 1000 0000 0000 0000 0000 0900 0000 0000 0000 0a00 0000 0000 0000

keycodes are uint16_t.

Send

0 1 2 3 4 5 6 7-31
ID const mode cmd const ^ 0xff mode ^ 0xf cmd ^ 0xf page index
01 a5 01 01 5a 0e 0e 00 01 00

Response

0 1 2 3 4 5 6 7 8 9 10 11 12-15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32-63
right back button slot 4 rumble mode win4 led mode win4 led color (R) win4 led color (G) win4 led color (B) left analog center left analog boundary right analog center right analog boundary left back button slot 1 start time left back button slot 2 start time left back button slot 3 start time left back button macro start time right back button slot 1 start time right back button slot 2 start time right back button slot 3 start time right back button macro start time
xx xx xx 00 xx xx xx xx xx xx xx xx xx 00 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx 00

Deadzone fields are present in latest firmwares for max 2, mini and win4.

Win4 led fields are 0 on other devices.

Configuration does not fit in a single response, use the index to get all parts.

Checksum for read config

Send

0 1 2 3 4 5-31
ID const mode cmd const ^ 0xff mode ^ 0xf cmd ^ 0xf
01 a5 01 02 5a 0e 0d 00

Response

0 1 2 3 4 5-7 8 9 10 11 12 13-23 24 25 26-63
ID const mode cmd const ^ 0xff mode ^ 0xff cmd ^ 0xff ready state gamepad version minor gamepad version major keyboard version minor keyboard version major checksum other bytes
01 a5 01 00 5a 0e 0d 00 aa xx xx xx xx 00 xx xx xx

Checksum is the sum of all configuration bytes (whole configuration).

No need to wait for ready state here.

Prepare for write

Send

0 1 2 3 4 5-31
ID const mode cmd const ^ 0xff mode ^ 0xf cmd ^ 0xf
01 a5 02 00 5a 0d 0f 00

Response

0 1 2 3 4 5-7 8 9 10 11 12 13-63
ID const mode cmd const ^ 0xff mode ^ 0xff cmd ^ 0xff ready state gamepad version minor gamepad version major keyboard version minor keyboard version major unk
01 a5 02 00 5a 0d 0f 00 xx xx xx xx xx xx

Initialization is successful if byte 8 contains 0xaa.

Write config

You must send a total of 256 bytes, each packet is 32 bytes. (8 * 32)

Use the index to specify the packet number.

Writes don't have a response.

Send

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24-31
ID const mode cmd const ^ 0xff mode ^ 0xf cmd ^ 0xf index dpad up dpad down dpad left dpad right A B X Y
01 a5 02 01 5a 0d 0e 00 00 00 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx 00

Send

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24-31
ID const mode cmd const ^ 0xff mode ^ 0xf cmd ^ 0xf index left analog up left analog down left analog left left analog right L3 R3 start select
01 a5 02 01 5a 0d 0e 00 01 00 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx 00

Send

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18-31
ID const mode cmd const ^ 0xff mode ^ 0xf cmd ^ 0xf index menu L1 R1 L2 R2
01 a5 02 01 5a 0d 0e 00 02 00 xx xx xx xx xx xx xx xx xx xx 00

Send

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22-31
ID const mode cmd const ^ 0xff mode ^ 0xf cmd ^ 0xf index left back button slot 1 left back button slot 2 left back button slot 3 left back button slot 4 right back button slot 1 right back button slot 2 right back button slot 3
01 a5 02 01 5a 0d 0e 00 03 00 xx xx xx xx xx xx xx xx xx xx xx xx xx xx 00

Send

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20-31
ID const mode cmd const ^ 0xff mode ^ 0xf cmd ^ 0xf index right back button slot 4 rumble mode win4 led mode win4 led color (R) win4 led color (G) win4 led color (B) left analog center left analog boundary right analog center right analog boundary
01 a5 02 01 5a 0d 0e 00 04 00 xx xx xx xx xx xx xx xx xx xx xx xx 00

Send

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24-31
ID const mode cmd const ^ 0xff mode ^ 0xf cmd ^ 0xf index left back button slot 1 start time left back button slot 2 start time left back button slot 3 start time left back button macro start time right back button slot 1 start time right back button slot 2 start time right back button slot 3 start time right back button macro start time
01 a5 02 01 5a 0d 0e 00 05 00 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx 00

Send

0 1 2 3 4 5 6 7 8-31
ID const mode cmd const ^ 0xff mode ^ 0xf cmd ^ 0xf index
01 a5 02 01 5a 0d 0e 00 06 00 00

Send

0 1 2 3 4 5 6 7 8-31
ID const mode cmd const ^ 0xff mode ^ 0xf cmd ^ 0xf index
01 a5 02 01 5a 0d 0e 00 07 00 00

Checksum pending written config in memory

Send

0 1 2 3 4 5-31
ID const mode cmd const ^ 0xff mode ^ 0xf cmd ^ 0xf
01 a5 02 02 5a 0d 0d 00

Response

0 1 2 3 4 5-7 8 9 10 11 12 13-23 24 25 26-63
ID const mode cmd const ^ 0xff mode ^ 0xff cmd ^ 0xff ready state gamepad version minor gamepad version major keyboard version minor keyboard version major checksum unk
01 a5 02 02 5a 0d 0d 00 aa xx xx xx xx 00 xx xx xx

Checksum is the sum of all configuration bytes (whole configuration).

No need to wait for ready state here.

Commit configuration to the controller

Send

0 1 2 3 4 5-31
ID const mode cmd const ^ 0xff mode ^ 0xf cmd ^ 0xf
01 a5 02 03 5a 0d 0c 00

The controller does not read the configuration from memory, so it is not possible to create configs on fly in memory to avoid commits.