This is from our WIP2 Bluetooth branch which is about a year out of date.
I copied files to other location, then created this branch and used WinMerge to merge in all related changes,
Without hopefully undoing any of the other changes
The first gigabyte fix, was to always force the keyboard into boot protocol mode, which appeared to work well for all of the keyboards I tried.
Unforationally it caused issues with some wireless keyboard/mouse combo packages, including some logitech and some microsoft keyboards.
This version instead, I created a list (currently only one vendor id), of vendor id:product id, that need to be forced into boot mode. Knowing that if there is one keyboard vendor with this N key rollover feature, there are probably others. So while this list can be expanded, this requires users to update library. So added a method forceBootProtocol method to keyboard class that allows the user to try it out without needing to update the library sources.
The mouse test program has example of either setting it before the keyboard is initiated, as well as another way that when a connection is found it asks for the vendor id, and if it is the one of my gigabyte keyboard, it calls the function then.
While doing this I found some of the query functions like idVendor on the keyboard class would not compile as the keyboard object has multiple inheritence and both base classes have this. So like the joystick objects I added these to the top level function and these functions will direct the calls to the approrpriate places.
The gigabyte keyboard has an N key rollover input, that is different than all of our current keyboards.
So this code tells (currently All) keyboards to choose their boot protocol, which gets us back to the standard boot definition. Which alllows these keyboards to function like others.
While the other Joystick objects currently supported by the USB Host
code are driven by HID data, the Xbox does not contain HID data and
instead works at the top level.
To handle this I made the Joystick object use multiple InHeritence like:
class JoystickController : public USBDriver, public USBHIDInput
This allowed me to have the object work either way. This did add some
complexity in that some of the methods like is the object connected
(The bool operator) had to be overwritten as both of the bases classes
had it. In addition needed to update the other query functions to be
able to grab the data from mydevice or device depending on which type of
controller was connected.
Since this looked like a valid way, I then merged the Keyboard Extras
code that Keyboard and made it also do a similar multiple inheritance.
In this case however I restricted the HID top level report handle code
to only accept it if on the same object that claimed the keyboard.
The mouse test app was updated as well
The main issue was I used a setup structure on the stack which turned into garbage. Earlier I thought the data was copied, but it was not...
Found that fixing this resolved the earlier issue where I needed to defer the update. So removed the defered code, plus use member variable for the one byte output instead of static variable.
This commit should start to allow some Prolific PL2303 devices to work.
Tis device has a rather more complex initialization process than some
of the other devices.
I have tested this some with one device that I used to use to program
some older RS232 based boards plus talk to an SSC-32 device.
Test case is I am able to talk to SSC-32 and if I type in ver<cr>
It does properly return the version number.
The data I am seeing is pretty close to what
was documented in: https://gist.github.com/tommie/89011c5ac06553d5cdb8
as well as what the Linux driver outputs.
I also incorperated Frank's configuration options.
instead of having each HUB have 7 buffers, which can eat up space. We have each main object contribute currently one string buffer, which than when we initialize a Device_t we try to allocate one for it, likewise we release it when the Device is released.
Hopefully less memory needed.
Also updated such that the HIDInput classes can not retrieve these strings.
Changed test program to now also have list of HIDInput objects and when I detect a new one, I again print out info on it...
This delta, adds an extra keyboard object to handle those keys that are not part of the main keyboard class. In particular there are separate HID reports for some of the keys, such as Power keys, and multimedia keys.
These reports might be on separate Interface or in cases where the mouse and keyboard are on the same device, the extra reports may be on the Mouse Interface.
So far I have not tried to combine with Keyboard object as might require multiple inheritance which I would like to avoid.
Also I extended the special key mapping table to map several other keys like F1-12, Arrow, Home/end... To special values where the 0x80 bit is set. I used the same values as used for the Arduino Keyboard library. I did not use their defines as they used defines like KEY_F1, which already exists in core, but in core it is the scan code from the keyboard and not the end user value.