Add Nintendo Switch 2 Pro controller support - #19
Conversation
|
Thank you so much for your contribution. I haven't looked in detail; however, the cgo-part in |
|
Please also tell your LLM to clean up / rebase the commits. Additionally, make sure the last line of a commit tthat should show up the changelog contains
Please do 1 PR per atomic change; don't bundle multiple changes into a single PR. Your second change is problematic anway, as I've commented before. |
|
LMAO |
|
It now only adds NS2 Pro virtual USB HID device support, plus the minimal generic USB descriptor support, tests, docs, and a Go example feature. The USB descriptor/server changes are needed because the NS2 ProCon is not just a simple single-interface HID device. I tried to keep this PR focused only on the virtual NS2 Pro USB HID device support. The implementation is a bit tricky because it needs some USB descriptor/server support for the NS2 Pro enumeration path. If you feel this is still too much for VIIPER or not suitable to merge, please feel free to close it. I appreciate the review either way. Thank you for taking the time to look at this.
|
That's a smart way to workaround this! I don't think the cgo additions in the USBServer were at all necessary for that, though. Thank you, again! |
|
I additionally now noticed the presence of battery and charging state in the InputState struct. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #19 +/- ##
==========================================
+ Coverage 36.68% 43.30% +6.62%
==========================================
Files 72 78 +6
Lines 5139 5837 +698
==========================================
+ Hits 1885 2528 +643
+ Misses 3011 3003 -8
- Partials 243 306 +63 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1013721 to
717a95e
Compare
Changelog: feat
Thanks again
You should be good to Go! ;) |


Description
Adds Nintendo Switch 2 Pro / NS2 Pro virtual USB HID device support to VIIPER.
This includes the NS2 Pro device implementation, input state and output feedback handling, USB/HID descriptors for host recognition, registry integration for the API device type
ns2pro, a focused Go example, and device documentation.Related Issue
N/A
Motivation and Context
This change lets VIIPER create a virtual Nintendo Switch 2 Pro Controller over USB so host-side software can interact with it through the existing VIIPER API and device streaming model.
How Has This Been Tested?
go test ./...device/ns2pro,internal/server/usb,device, andinternal/server/api/handlerType of Change
Checklist