Brikwerk / nxbt

Control your Nintendo Switch through a website, terminal, or macro.
MIT License
790 stars 96 forks source link

USB gadget #27

Open dogtopus opened 2 years ago

dogtopus commented 2 years ago

With libraries like python-functionfs it should be possible to reuse some existing HID code in nxbt and make a USB gadget on Linux that emulates the Pro Controller. (For example my PS4 controller emulator/protocol testing ground uses it)

(One thing worth noting though is that python-functionfs in particular starts up as root and forks as a process under normal user for security reasons and needs to be take into account when cross platform is a goal)

Brikwerk commented 2 years ago

This is an interesting idea. What you're suggesting, if I'm understanding correctly, could be a Raspberry Pi Zero W emulating a Pro Controller but plugged into another computer. The host computer (that the Pi is plugged into) could send commands to the Pi?

I would definitely be willing to investigate this more when I have bandwidth for new features. I'll add an enhancement tag for now, though. If anyone else wants to investigate this or provide extra details/wishes, feel free to comment.

dogtopus commented 2 years ago

What you're suggesting, if I'm understanding correctly, could be a Raspberry Pi Zero W emulating a Pro Controller but plugged into another computer. The host computer (that the Pi is plugged into) could send commands to the Pi?

Pretty much except that the computer can also be a Switch (i.e. you plug the Zero W in, it gets picked up as a wired pro controller and it starts there).