Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit the number of simultaneous controllers #193

Open
2 tasks done
Benvii opened this issue Apr 13, 2022 · 0 comments · May be fixed by #194
Open
2 tasks done

Limit the number of simultaneous controllers #193

Benvii opened this issue Apr 13, 2022 · 0 comments · May be fixed by #194

Comments

@Benvii
Copy link

Benvii commented Apr 13, 2022

Hi,
First of all thank you for this great library/module, pretty simple to use.

Use case :
As a dr4drv user I would like to be able to limit the number of simultaneous controllers (in my case limit to 1 at most), but still handle disconnections (allow new controllers at disconnection if the limit isn't reached).

More context about my use case :
We are using it at the DonkeyCar community to control RC Cars using PS4 controllers. I'm actually setting up a stand as part of a Makers event (called Nantes Makers Campus in France), we will let attendees play with several cars, so multiple PS4 controllers at the same time, each on connected to one rc-car. All rc-cars is running ds4drv an needs to be paired with only 1 controllers.

Implementation details :

  • Add a CLI argument called --controller-limit MAX_NUMBER_OF_CONTROLLERS
  • In the devices scanning loop if the limit is reached, wait for one device to be disconnected

I made a first implementation of this feature and will push a PR today, hope it's a good approach.

Thanks in advance.

Benvii added a commit to Benvii/ds4drv that referenced this issue Apr 13, 2022
…mit the number of simultaneous controllers connected
@Benvii Benvii changed the title Limit the number of simuntaneous controllers Limit the number of simultaneous controllers Apr 13, 2022
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 a pull request may close this issue.

1 participant