RandomInsano / pscontroller-rs

Rust driver for the Sony PlayStation controllers using embedded-hal
Apache License 2.0
15 stars 6 forks source link

Implement forced polling #13

Open RandomInsano opened 6 years ago

RandomInsano commented 6 years ago

Right now, we have two ways to get a controller:

  1. A polling command that tries to detect which controller is plugged in
  2. A raw polling command that you then unsafely force to be the controller you want

This will be a bit of grunt work, but what we should have are calls for the unguessable controllers like the Guitar Hero guitar, Mad Maestro baton, etc. There should be an interface to ask the controller struct what its identifier is so that some sanity checking can be done. For example, when polling for the baton, return an errored Result<> if there is a DualShock 2 plugged in.

There should also be a custom Error enum for this call.