[PR #230] [MERGED] Implement ESB forwarding, fix haptics/command overlap #252

Closed
opened 2026-10-22 05:08:17 +00:00 by roman · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/safijari/openpuck/pull/230
Author: @Leseratte10
Created: 8/10/2026
Status: ✅ Merged
Merged: 8/21/2026
Merged by: @safijari

Base: main ← Head: fwdtest


📝 Commits (10+)

📊 Changes

21 files changed (+447 additions, -450 deletions)

View changed files

📝 OpenPuck/OpenPuck.ino (+1 -0)
📝 OpenPuck/bonds.h (+6 -0)
📝 OpenPuck/config.cpp (+3 -6)
📝 OpenPuck/haptics.cpp (+101 -134)
📝 OpenPuck/haptics.h (+5 -22)
📝 OpenPuck/identity.cpp (+9 -4)
📝 OpenPuck/mode_hidgyro.cpp (+1 -0)
📝 OpenPuck/mode_ps3.cpp (+1 -0)
📝 OpenPuck/mode_ps5.cpp (+1 -0)
📝 OpenPuck/mode_switch_hori.cpp (+1 -0)
📝 OpenPuck/mode_switch_pro.cpp (+1 -0)
📝 OpenPuck/mode_xinput.cpp (+1 -0)
📝 OpenPuck/puck_hid.cpp (+168 -211)
📝 OpenPuck/puck_hid.h (+0 -4)
📝 OpenPuck/rf_link.cpp (+43 -0)
📝 OpenPuck/serial_console.cpp (+1 -22)
➕ OpenPuck/steam_commands.h (+86 -0)
📝 OpenPuck/webusb_config.cpp (+3 -4)
📝 ReversePuck/scpair.py (+2 -5)
📝 docs/PROTOCOL.md (+13 -32)

...and 1 more files

📄 Description

After wasting almost seven hours, and using up my entire Claude limit twice, I believe I have a very early PR ready that should fix / implement #227. Don't look at the messy commit history, I'll fix the clang-format errors and squash them all together once it's ready.

It still has a bunch of ToDo's in it, but it finally allows you to do the following:

$ python3 scpair.py list
Puck: FXB1111111111 (OpenPuck), firmware 6A18D053 (OpenPuck 0.9.40-pr230+d3efc041 d3efc041)
  slot 0: Empty
  slot 1: second (key aaaaaaaaaaaaaaaa), connected to controller FXA3333333333
  slot 2: asd (key bbbbbbbbbbbbbbbb), connected to controller FXA4444444444
  slot 3: Empty

Controller (wireless): FXA3333333333, firmware 6A628345 (fec01234c8af)
  slot 0: FXB1111111111 (key aaaaaaaaaaaaaaaa)
  slot 1: Empty

Controller (wireless): FXA4444444444, firmware 6A628345 (fec01234c8af)
  slot 0: FXB1111111111 (key bbbbbbbbbbbbbbbb)
  slot 1: Empty

This means, requests for a controller's bond records, for a controller's serial number and for a controller's firmware version are now no longer spoofed by OpenPuck but instead actually forwarded to the controller wirelessly and then answered by the controller. This should fix #227 and #205 and #208 and probably others, too.

It also means that quite a bit of workaround code can now be removed. In fact this PR removes more lines of code than it adds, and I'm fairly certain there's more code (like related to haptics) that could now be removed.

There's still a couple things that should be checked before merge?

  • Which of the other reports should be forwarded to the controller as well instead of being handled on the Puck?
  • Is there a cleaner way to make the TinyUSB library return -EPIPE to a USB transfer?
  • Do we need to add a timeout in case the controller never answers or do we rely on the next rid=2 request to reset a stuck query?
  • Is there more code (particularly related to haptics) that is now obsolete and can be removed?

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/safijari/openpuck/pull/230 **Author:** [@Leseratte10](https://github.com/Leseratte10) **Created:** 8/10/2026 **Status:** ✅ Merged **Merged:** 8/21/2026 **Merged by:** [@safijari](https://github.com/safijari) **Base:** `main` ← **Head:** `fwdtest` --- ### 📝 Commits (10+) - [`bdd85a4`](https://github.com/safijari/openpuck/commit/bdd85a48244af38708490d920f6aa46c3a6f1be9) Test - [`1e4d59f`](https://github.com/safijari/openpuck/commit/1e4d59fbd9c579adbed83bc6dbedc64fbe346c94) Test - [`b5d2c1a`](https://github.com/safijari/openpuck/commit/b5d2c1a02be18d4d830b589acdfd988cc5dcb6ee) Test - [`ca27324`](https://github.com/safijari/openpuck/commit/ca2732476b1cc3d56d8d27768ffc92b1c190aac3) more dang tests - [`07079aa`](https://github.com/safijari/openpuck/commit/07079aa01784d5d7114e8b40502bba20612455c8) test - [`95fd4b2`](https://github.com/safijari/openpuck/commit/95fd4b219243148b0383167f5747d6336850f598) Cleanup - [`2c99df2`](https://github.com/safijari/openpuck/commit/2c99df22ab09b4d183f09afe5bffad5051149363) Stall req if not ready - [`85aceb0`](https://github.com/safijari/openpuck/commit/85aceb0591ab5f00028487b2019e7c96ee1919b6) Stupid library bugs - [`b8fef0c`](https://github.com/safijari/openpuck/commit/b8fef0c68e1a23f983a0a33ae981348ab6def00b) More fuckery - [`8443620`](https://github.com/safijari/openpuck/commit/8443620404600c318743a99b5d6e14a986035aa6) Cleanup ### 📊 Changes **21 files changed** (+447 additions, -450 deletions) <details> <summary>View changed files</summary> 📝 `OpenPuck/OpenPuck.ino` (+1 -0) 📝 `OpenPuck/bonds.h` (+6 -0) 📝 `OpenPuck/config.cpp` (+3 -6) 📝 `OpenPuck/haptics.cpp` (+101 -134) 📝 `OpenPuck/haptics.h` (+5 -22) 📝 `OpenPuck/identity.cpp` (+9 -4) 📝 `OpenPuck/mode_hidgyro.cpp` (+1 -0) 📝 `OpenPuck/mode_ps3.cpp` (+1 -0) 📝 `OpenPuck/mode_ps5.cpp` (+1 -0) 📝 `OpenPuck/mode_switch_hori.cpp` (+1 -0) 📝 `OpenPuck/mode_switch_pro.cpp` (+1 -0) 📝 `OpenPuck/mode_xinput.cpp` (+1 -0) 📝 `OpenPuck/puck_hid.cpp` (+168 -211) 📝 `OpenPuck/puck_hid.h` (+0 -4) 📝 `OpenPuck/rf_link.cpp` (+43 -0) 📝 `OpenPuck/serial_console.cpp` (+1 -22) ➕ `OpenPuck/steam_commands.h` (+86 -0) 📝 `OpenPuck/webusb_config.cpp` (+3 -4) 📝 `ReversePuck/scpair.py` (+2 -5) 📝 `docs/PROTOCOL.md` (+13 -32) _...and 1 more files_ </details> ### 📄 Description After wasting almost seven hours, and using up my entire Claude limit twice, I believe I have a very early PR ready that should fix / implement #227. Don't look at the messy commit history, I'll fix the clang-format errors and squash them all together once it's ready. It still has a bunch of ToDo's in it, but it finally allows you to do the following: ``` $ python3 scpair.py list Puck: FXB1111111111 (OpenPuck), firmware 6A18D053 (OpenPuck 0.9.40-pr230+d3efc041 d3efc041) slot 0: Empty slot 1: second (key aaaaaaaaaaaaaaaa), connected to controller FXA3333333333 slot 2: asd (key bbbbbbbbbbbbbbbb), connected to controller FXA4444444444 slot 3: Empty Controller (wireless): FXA3333333333, firmware 6A628345 (fec01234c8af) slot 0: FXB1111111111 (key aaaaaaaaaaaaaaaa) slot 1: Empty Controller (wireless): FXA4444444444, firmware 6A628345 (fec01234c8af) slot 0: FXB1111111111 (key bbbbbbbbbbbbbbbb) slot 1: Empty ``` This means, requests for a controller's bond records, for a controller's serial number and for a controller's firmware version are now no longer spoofed by OpenPuck but instead actually forwarded to the controller wirelessly and then answered by the controller. This should fix #227 and #205 and #208 and probably others, too. It also means that quite a bit of workaround code can now be removed. In fact this PR removes more lines of code than it adds, and I'm fairly certain there's more code (like related to haptics) that could now be removed. There's still a couple things that should be checked before merge? - Which of the other reports should be forwarded to the controller as well instead of being handled on the Puck? - Is there a cleaner way to make the TinyUSB library return -EPIPE to a USB transfer? - Do we need to add a timeout in case the controller never answers or do we rely on the next rid=2 request to reset a stuck query? - Is there more code (particularly related to haptics) that is now obsolete and can be removed? --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
roman 2026-10-22 05:08:17 +00:00
Sign in to join this conversation.
No labels
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
safijari/openpuck#252
No description provided.