Documentation for USBHost_t36?

JKIM

Active member
I am trying to understand the general architecture of the HID device drivers in the USBHost_t36 library.
I didn't find any overview docs on the library, so I am researching it from the code.

Specifically, I don't understand how the relationship between different objects is established, like the host object, a hub, hid parser and the hid device.

As an example (and this may be my lack of skill with C++):

Creating a MouseController object includes the following initialization:
Code:
USBHost myusb;
USBHub hub1(myusb);
USBHIDParser hid1(myusb);
MouseController mouse1(myusb);

But looking at the constructor for the MouseController, it doesn't seem to do *anything* with the USBHost that is passed in:
Code:
MouseController(USBHost &host) { init(); }
I see this same pattern with USBHub as well, so I must be missing something!

as well, I don't understand the call to check if a driver has been claimed, such as:
Code:
if(mouse1)
{
}

I expect that be a pointer to the mouse1 object that was previously instantiated, but the check does return false if the driver hasn't been claimed.

Any clues on what I should look at to understand this?
 
OK, I am guessing the constructor doesn't use the USBHost parameter, but the constructor is defined this way to force the caller to have already created a USBHost object as a safeguard?
 
Back
Top