07-15-2008 01:58 PM - edited 07-15-2008 02:01 PM
I suppose you could implement the HID Device Class spec as a base class that would give you basic mouse and keyboard functionality. The problem is the spec needs to account for all sorts of corner cases that most users will never encounter, which of course adds to the complexity. (I have yet to run across a device that uses my cheek or little toe to activate it. HID Device Class spec p 46.) If you want a truly generic driver you'd need to implement all that 'extra' stuff. It would be interesting as an academic exercise, but I think it would have limited real-world value. (Don't let my opinion stop you from doing it though.)
Intaris wrote:
Regarding the LVOOP approach I was thinking more of a generic HID driver.
Intaris wrote:
The problem with just implementing a child class for a mouse with wheel is that there are many different HID devices out there which may also have a wheel but aren't mice. How to handle these?
07-15-2008 03:02 PM
07-15-2008 03:09 PM - edited 07-15-2008 03:11 PM
07-15-2008 07:16 PM
07-16-2008 01:26 AM
07-16-2008 05:29 AM
Daklu and Shane,
You two are doing a great job of working through the forest of USB spec to show a path that we will bea able to follow.
Q:
RE: class structure, Would a parent class for all USB devices all adaptation of mouse implementation to other classes of devices?
Thank you both very much!
Ben
07-16-2008 07:33 AM
07-16-2008 10:28 AM - edited 07-16-2008 10:33 AM
"Sometimes a second pair of eyes helps in spotting glaring mistakes."
Sure thing. I'll be happy to run it through my spell-checker. You can send it to me at v-davsny@BigSoftwareCompanyInRedmondThatEverybodyHates.com
"So the HID device would be a single class containing an array of sub-objects (not children) for helping interpret the report(s)."
I'm no class designer so I'm sure I'm missing something here. Why would you use classes and objects within the generic HID class? It seems like it's adding an unnecessary layer of complexity. Is there an inheritance structure within the generic HID class?
I *think* I understand your intent a little bit better. Tell me if this is correct... The generic HID class will parse and report all the standard data in the USB transaction, such as mouse position and keyboard buttons. Non-standard data, such as a scroll wheel, will be reported in a generic format. For example, it could be a cluster with a string and integer where the string contains the string descriptor of the data and the integer contains the value. For non-standard data, the calling vi will be responsible for knowing what string descriptors to look for and how to interpret the data. Am I close?
BTW Shane, I went back and read the beginning of the thread. Somehow I missed all of part 4, except for the questions at the end. In the future I'll try to remember to actually read a thread before responding to it. (No promises though.)
"You two are doing a great job of working through the forest of USB spec to show a path that we will bea able to follow."
"Forest" is an apt description. But it's not a nice old growth forest with towering redwoods... it's a tropical forest with tangly bushes, poisonous creatures, and unexpected rivers all preventing you from making progress. Occasionally you stumble upon some ruins and say, "Aha! This is what I'm looking for!" Nevertheless, I'm glad you're finding value in the discussion. FWIW, although I have to relearn everything whenever I get into USB again, every time I understand it a little bit better. Two steps forward, 1.9 steps back.
"Would a parent class for all USB devices all adaptation of mouse implementation to other classes of devices?"
I'm glad Shane responded to this. I can't even get my brain to parse the question into something meaningful.
07-16-2008 10:35 AM
07-16-2008 10:47 AM
"...but then I thought that the letters "ow" were missing, which happens to be how my brain feels when I'm reading the USB spec."
ROFL!