Giter Club home page Giter Club logo

Comments (6)

roblabla avatar roblabla commented on August 21, 2024

Alright small update: I managed to identify the code in the steam client that interacts with the Steam Controller. And fortunately, a lot of symbols and assert messages are left over, allowing me to find the official name for more or less every single packet, along with a whole host of packets that seem to be used for other valve hardware - The valve index and steam controller share a lot of code.

I'll update the table above with this newfound information as I go.

from opensteamcontroller.

tiehichi avatar tiehichi commented on August 21, 2024

Hello, I am trying to analyze the protocol of Steam Controller BLE HID, I updated it here, hope it can help you.
There are some data that I haven’t had time to update, because English is not my native language, I write very slowly😂.
Your document is very helpful to me, looking forward to your update😄

from opensteamcontroller.

roblabla avatar roblabla commented on August 21, 2024

Hey @tiehichi thanks for this, it's pretty useful! I've been focusing on this weird proprietary protocol and haven't looked at the actual input reports at all so far :). The HID layer is identical both for BLE, USB and Enhanced ShockBurst (the protocol used to talk to the dongle), so a lot of your findings should apply everywhere.

I'll make a PR later today with my latest findings, in a couple of proper markdowns :). I've figured out a couple of interesting things - it seems there's still some hidden features in the Steam Controller firmware that are going to be fun to play around with ^^.

from opensteamcontroller.

nrc4867 avatar nrc4867 commented on August 21, 2024

@tiehichi I have previously categorized some of the meaning behind the bytes in valve mode.

I think that the second byte is a mode indicator. I haven't dug into what the meaning of the bytes are when the byte is 0x05 but I have the meaning of the bytes when the mode is 0x04.

The steam controller seems to have 5 distinct modes; The modes are on the second byte of the packet.

Mode Byte Value Description
Idle 0x05 The controller is in an idle state
Active 0x04 The controller is in an active state (Or waiting for input before switching back to idle)
Buttons 0x14 A button is being pressed/released
Triggers 0x24 A trigger is being depressed
Joysticks 0x84 The joystick is being used

When using more than one mode (aka, buttons and joysticks) these modes are or'ed together.

The touch pads modes are on the third byte of the packet. When the touch pads are in use the second byte is set to active and the following mode conditions are set.

Touchpad-Mode Byte Value Description
Left pad 0x01 Left touch pad
Right pad 0x02 Right touch pad

Similarly when both pads are in use the bytes are or'ed together for a value of 0x03.

Then the inputs always start on the forth byte. When all controls are being touched the controls are on the packet in the order: buttons->triggers->joystick->touchpads. All the input cannot fit on one packet so the right touch pad seems to be left off.

When buttons are active they take up 3 bytes of space:

Button Byte Value
A 4 0x80
B 4 0x20
X 4 0x40
Y 4 0x10
Left Shoulder 4 0x08
Right Shoulder 4 0x04
Left Trigger Press 4 0x02
Right Trigger Press 4 0x01
Home 5 0x20
Select 5 0x10
Play 5 0x40
Back Left 5 0x80
Back Right 6 0x01
Joystick Press 6 0x40
Left Touch pad press 6 0x02
Right Touch Press 6 0x04

When the trigger is depressed it takes up 2 bytes of space.

Trigger Byte
Left 4
Right 5

When the joystick is active it takes up 4 bytes of space. this can be converted into a short and then divided by 32767 for a float between -1 to +1.

Joystick Byte Description
4 & 5 The Y value
6 & 7 The X value

Finally the touch pads can appear in the packet independently. Each touch pad takes up 4 bytes of space and when both are used the bytes the right touch pad uses are shifted so they appear as
left touch pad->right touch pad, in the packet.

touch pad Byte Description
Left (4, 5) & (6, 7) The X/Y value
Right (4, 5) & (6, 7) The X/Y value

from opensteamcontroller.

tiehichi avatar tiehichi commented on August 21, 2024

Hey @roblabla , looking forward to your update, these features must be very cool!
Hello @nrc4867 , thank you very much for these information! I am trying to connect SteamController to nintendo switch using ESP32, these data are very useful for me!
And if I have any new discoveries, I will share them in time😁

from opensteamcontroller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.