Turns out they are a lot different than other PS3 controllers.
When plugged into USB, it appears like these units do not send
any reports. They do allow us to do pairing (which is differnt)
than other PS3, as well as set the Bulb LED color, which I now
have it alternating colors every few seconds and also it tries
to pair it with a BT dongle
When connected to Bluetooth, it now is setup to generate reports,
as well as again set the bulb color and rumble.
So far it maps the 3 button bytes into the buttons field and then
simply copies most all of the data down into Axis, starting where
the Trigger button is.
JoystickBT.ino was updated, to know about this controller and as
mentioned above in the USB case it tries to pair and plays with the
color of bulb.
In the BT case it tries to display data. I did a quick and dirty
change of the Accel/Gyro like stuff which is probably totally wrong.
Pressing some of the buttons will set bulb color and pressing trigger
will set rumble.
PS3 Motion controller - very little mapping of axis
Fixed the order of bytes output when we show a bluetooth address.
Also moved the updated JoystickBT example up one level, such that the new version overwrote the previous version...
Did quick test with PS3...
Trying out using the extended Inquiry data search instead of the real simple one. This allows us to hopefully get the name of the device as part of this, which now allows the PS4 to know it is a PS4 on the Pair type constructor.
Still WIP to understand XBox one...
Support to pair PS3 if it knows the BTADDR and user presses select and PS button and plugged in USB.
Remembers remote name, and tries to get it when PAIR version of code is running. (Currently fails).
Does some mapping of PS3 Bluetooth data to match USB HID data.
Warning: as part of debuggigng why joystickType value was changing, I changed the class to make it a function you call instead of just a member variable. Should mark it inline... I think I caught all of the places in example code that was accessing it. If we find we want ability for user probram to update it, should add another member to explicityly set it.
I have some PS3 support working... Hope I did not break PS4.... ;)
Also This assumes that you did a bind of the dongle to PS3 external, no support yet, I did this on RPI3...
Rumble needs work!
Hopefully did not break other things...
Find that the PS4 requires you to ask to connect versus some/most other devices will do the request...
Also found issue without printing, where adding a delay(1) in a couple of places appears to help when Serial1 printing is not on
There are some of the BT dongles that have a device type of 0xff instead of the correct one, so added table of VID:PID to check against, currently only one in list. If it is this pair the Bluetooth system will claim it.
Code is still WIP, needs lots of reorg and fix up and lots more to figure out.
But started working toward the Bluetooth HID devices and have the messages going back and forth from my BT dongle to a small BT keyboard.
It is finally showing keys being pressed and the like.
Code needs lots of work. Like does pairing everytime, need to make that optional.
Also need to figure out where to split off the HID stuff from Root BT stuff. ...
Plus it mainly prints lots of debug information.
WIP - I captured the USB packet information for the startup of a Bluetooth adapter. I am now in the process of understanding the data that is being sent back and forth and have the device now partially configured.
Nothing works yet!
WIP - So far i am getting the basic values for 1 XBox 360 controller. The device should handle up to 4 devices, but so far hard coded to only handle 1...