As a lot of you are aware, Nintendo recently released the Nintendo Switch, a portable game console about the size of a tablet. The main controller they released with it are called the Joy-Cons which are two separate controllers, each with 4 buttons on the front, a joystick, bumper, trigger, minus/plus button and a “home” button. The neat thing Nintendo decided to do was make these controllers attach to the Nintendo Switch using bluetooth.

As many discovered after the release, you can pair these controllers up to your computer, as well as the Pro Controller. Some of the buttons are mapped fine to allow you to play certain games. This lead me to pick some up to try them for myself as well mess around with them in Unity3D. I spent some time and setup a small project and mapped out the button and axis for the two controllers in Unity3D for Windows.

I shared this with some developers and got the question, “Can you use the sensors in the controller?”. As I found out, the answer for that is no. So I set off on a quest, a quest to find out what I could do to make this functionality available. You might ask why? Won’t the Unity3D devs make these features available to us? Maybe…that’s a possibility and I’ll definitely hope so. That being said, I won’t be holding my breath.

The first thing I decided to attempt was how to communicate with the devices in the first place. Having no experience with this sort of task, I took to the internet. Some people suggested using something like Winsock to communicate with the devices. After spending a few days working through it, I found this to be useless.

The next thing I thought of I found after looking through the device settings that show up when looking under the Devices window in Windows 7. The controllers use drivers for HID, which let me to go looking for a way to communicate with Human Interface Devices, like mice or keyboards, which I knew there had to be SOMEWHERE! Sure enough, I stumbled upon an open source library for HID communications. This library, which can be found here, supported Windows, Mac, Linux and Android and even came along with an example project. So I downloaded the source and ran the Visual Studio project to figure out what there was. It actually wasn’t super complicated and lead me to a lot of other information. I actually managed to mess around with it enough to get the motor to turn in the controller and even the Home button the right controller to light up. Sadly, it wasn’t something I could reproduce consistently.

What I did learn was how to read the input buffers from the controller. The first 4 bytes represent the controller data for buttons. The first byte is actually some sort of flag that’s consistent when just reading the buffer. The second byte represents the 4 face buttons and the SL/SR buttons. The third byte represents the rest of the buttons, including the click for the joystick. The fourth byte represents the Joystick as far as what axis it’s pressed along. This was the most interesting part because it seems to indicate that if you want the axis x and y values, you have to query the device. It starts from 0 and goes to 7. 8 is the neutral point for the joystick.

The things I’ve still got to learn is how to query data from the device for the sensors. I do know that there are 49 bytes of data I can write to the device. 1 being a flag, the other 48 being the data you want to send. I could try EVERY combination, which would take a long time as these values can range from 0-255. That’s 256^49, which is roughly 1008691e+112. Or in layman’s term, a HELL OF A LOT. This is my Brick Wall. I could give it a try and come back to you in a few years when it finishes and hope that it hasn’t bricked my controllers. However, brick walls are not impossible to surpass, sometimes you just have to go around them. This leads me to my next possible steps. For that I need two items, a Nintendo Switch and a Bluetooth Sniffer dongle. There are a variety of those devices out there, and ways to use them. Of course, this is costly. First I have to purchase a Nintendo Switch, which I plan to do any ways. But secondly, buy a Bluetooth Sniffer or Spectrum Analyzer, which can range from $25 to $130 and are often sold out.

So here I am, at the end of my road for now on this project. Hopefully this won’t be the permanent end to it, I’d love to chase this further or maybe Nintendo will release the specs for the controllers. Who knows.