This delta originated to do the work similar to what was done
for the MIDI code base and support two versions of the object.
All of the code was renamed to a new base class USBSerialBase
which has everything, except the main buffer.
Two sub-classes were made that the only difference is the size of the
buffer to hold all of the USB RX and TX information.
This started off to try to support an FT2232H device which transers
512 bytes at a time instead of what most of our devices were transfering
which is 64 bytes.
While doing this, I found that we have a similar issue with the T4.x
boards which now transfer 512 bytes as well and our Serial object would
not handle it.
So there are two sublasses:
```
USBSerial - for those up to 64 byte transfers
USBSerial_BigBuffer - for up to 512 bytes
```
Note: by default the biguffer version will only handle those
devices > 64 bytes, but you can pass in an optional parameter of the
minimum size, so doing something like:
```
USBSerial_BigBuffer userial(myusb, 1);
```
Will handle all up to 512.
Also the FTDI2232H supports two USB to Serial objects, and our code
was setup that in most cases including when we put in VID:PID pair in
our table, the code would claim would claim
the object at device level so only one USB Serial adapter.
So changed table to support saying for this VID:PID claim at
interface level. It now works, but not sure for the device I have as
it is a USB to Serial and JTAG and not sure how to test 2nd one.
But while doing this created a test sketch for Multiple Host USB Serial
objects and the two are claimed by this.
I also created a new version of the Teensy USBToSerial example sketch
that if you configure USB type to Dual Serial or Triple Serial will output
SerialUSB1 to Serial2 and SerialUSB2 to Serial3, which works, and then
tried T4 configured for Dual plugged
into T4.1 with above sketch and could talk to both USB Serial adapters.
The Claim code was rearranged a lot, so hopefully did not break
anything.
But tested with
T4 as mentioned, both Single and Dual Serial
T3.2 with Single Serial, plus: Serial, Joystick, Keyboard...
FTDI - USB to Serial adapter (Sparkfun)
CP2104 - Adafruit
PL2303 - some clones ...
So hopefully most things are still working
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
Did some quick edits, to try this out on my T4. beta
Decided maybe needed top header to mention this currently requires SPIN, ILI9341_t3n libraries, Also thought I would mention which pins, which I made different for T3.6 versis T4.
Also removed the ili9341_due_config.h file as nothing in it was used.
And added a message to the screen saying it was waiting for Joystick object.
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...