Skip to content

ReversePuck: pairing commands to read, write and erase each slot over USB - #326

Open
MisterAnderson91 wants to merge 1 commit into
safijari:mainfrom
MisterAnderson91:reversepuck-pairing-commands
Open

MisterAnderson91 wants to merge 1 commit into
safijari:mainfrom
MisterAnderson91:reversepuck-pairing-commands

Conversation

@MisterAnderson91

Copy link
Copy Markdown

ReversePuck pairing commands, for SC Hammer compatibility: pairing tools can read, write and erase each of the dongle's 8 pairing slots over USB, and tell a ReversePuck apart from a real Steam Controller.

SC Hammer (a GUI for moving, swapping and pairing Steam Controller pairings) has already been updated for this: v0.2.0 recognises a ReversePuck through rp/info and shows and manages all 8 slots. It works as soon as this is merged and the dongle is flashed. With current firmware SC Hammer just treats the dongle as an ordinary two-slot controller, as before.

One of three independent ReversePuck PRs (firmware fixes, pairing commands, Deck app + AppImage). They touch separate files and can be merged in any order.

Summary

  • 7c1572c Pairing commands to read, write and erase all 8 slots

Details

ReversePuck: read, write and delete pairing slots by number (ctrl_usb.cpp/.h)
Pairing tools could only read pairing slot 0 (0xA3), and every 0xEE write went to whichever slot find-or-alloc picked. This adds, over USB only:

  • 0xED keyed read for esb/bond, esb/bond_2 and new rp/bond/0..7. Empty slots return length 0, like a real controller.
  • 0xED "rp/info" → R P <version> <NBOND>, so tools can tell a ReversePuck from a real controller (a real one answers an unknown key with nothing).
  • 0xEE/0xEF with rp/bond/N write exactly slot N. Steam's esb/bond writes keep find-or-alloc, so Steam pairing is unchanged.
  • 0xF0 deletes the named slot.

Testing

Hardware: Steam Deck OLED with a ReversePuck (Pro Micro nRF52840) and an OpenPuck on 0.9.51.

  • SC Hammer 0.2.0 on the Deck reads all 8 slots from the dongle, and both sides of its pairing with the OpenPuck match.
  • Write, move, swap and erase were tested against SC Hammer's simulated ReversePuck, which answers these commands the way this firmware does; not yet on the real dongle.
  • SC Hammer still reads a real Steam Controller through esb/bond/esb/bond_2 as before (its tests, with simulated controllers).
  • make check (clang-format 18) passes, and make reversepuck builds.

🤖 Generated with Claude Code

Pairing tools could only read slot 0 (0xA3), and every 0xEE write went
to whichever slot find-or-alloc picked, so nothing could manage the
dongle's 8 pairing slots individually. Add, over USB:

- 0xED keyed read for esb/bond, esb/bond_2 and rp/bond/0..7 (len 0 when
  empty, like a real controller), plus "rp/info" -> R P <ver> <NBOND>
  so tools can tell a ReversePuck from a real Steam Controller
- 0xEE/0xEF with rp/bond/N write exactly slot N; Steam's esb/bond keys
  keep find-or-alloc
- 0xF0 keyed delete clears the named slot

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant