Nintendo Switch Bluetooth Controller Protocol
This page details all things Nintendo Switch controller protocol (Bluetooth only) related.
This article is still a work in progress! It was last updated June 24, 2022 and may have information that is missing or incomplete.
On top of this, specific details are given on how this looks implemented using the Bluedroid Bluetooth stack in the ESP-IDF development environment.
This work would not be possible without the following sources put together by community modding members.
Once a report comes in from the Nintendo Switch, it must be interpreted. The report type determines what type of data the Nintendo Switch will expect back from the controller. As far as I can tell, these reports are only sent through HID interrupt reports.
To obtain the report type, see the example below.
In this code example, we are acting on the callback event of a esp_hidd_cb_param_t type. The report type is specified by byte 0.
Report ID | Meaning | Details |
0x01 | Rumble data AND a Subcommand | The event data contains data to animate the linear actuators for HD rumble. This event data also contains a sub-command. Read on to learn more. |
0x03 | NFC and IR MCU firmware update packet | N/A |
0x10 | Rumble data | Only event data to animate the linear actuators for HD rumble. |
0x11 | Request NFC/IR MCU data | Read data from the IR sensor or NFC memory buffer from the controller. |
Sub-commands will interface with the various hardware built in to the controller to perform many functions. The Nintendo Switch controllers have SPI flash built in to hold firmware patches, controller colors, calibration data, and more.
In this code example, we are acting on the callback event of a esp_hidd_cb_param_t type. The sub-command is byte 10 of the incoming data.
Sub-Command | Meaning | Details |
0x00 | Get ONLY Controller State | ๏ปฟ |
0x01 | Bluetooth manual pairing | ๏ปฟ |
0x02 | Request device info | ๏ปฟ |
0x03 | Request input report mode | ๏ปฟ |
0x04 | Trigger buttons time elapsed | ๏ปฟ |
0x05 | Get page list state | ๏ปฟ |
0x06 | Set HCI state | ๏ปฟ |
0x07 | Reset pairing info | ๏ปฟ |
0x08 | Set low power shipping state | ๏ปฟ |
0x10 | SPI Flash read | ๏ปฟ |
0x11 | SPI Flash write | ๏ปฟ |
0x12 | SPI Sector erase | ๏ปฟ |
0x20 | Reset NFC/IR MCU | ๏ปฟ |
0x21 | Set NFC/IR MCU config | ๏ปฟ |
0x22 | Set NFC/IR state | ๏ปฟ |
0x30 | Set player number (lights) | ๏ปฟ |
0x31 | Get player number (lights) | ๏ปฟ |
0x38 | Set "Home" button LED | ๏ปฟ |
0x40 | Enable 6-axis IMU | ๏ปฟ |
0x41 | Set 6-axis sensitivity | ๏ปฟ |
0x42 | Write IMU registers | ๏ปฟ |
0x43 | Read IMU registers | ๏ปฟ |
0x48 | Enable vibration | ๏ปฟ |
๏ปฟ
