Implement support for Sony DualShock 3 #41
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement support for the Sony DualShock 3 controller.
This implementation was based on the linux driver for this controller and tested manually using both Bluetooth connection and USB cable.
The DS3 reports battery capacity in a odd way. It actually only reports 7 possible values: 0, 1, 25, 50, 75, 100% battery capacity, charging-not-full or charging-full. So I had to choose which value of battery capacity when it reports charging-not-full. I opted for 75% so the user wouldn't think the battery is full when it is not. But this leads to a funny situation:
Anyway, this is just a minor inconvenience, but it is confusing.
I tried to follow all code conventions, but I may have failed.
Please point out errors and improvements I could make to the code.
All tests were done using a DualShock 3 model CECHZC2U. I can adapt the code to other similar models if needed, however, I don't have other DS3 controllers. I don't think there are major differences, at least according to the linux driver.
Hope we can get this code merged, I think it would help a few users.
It was a fun little project.