On Jan 21, 2006, at 2:25 AM, Christian Klippel wrote:
hi,
Am Samstag 21 Januar 2006 06:28 schrieb Mathieu Bouchard:
On Fri, 20 Jan 2006, Christian Klippel wrote:
yea, good idea, but impossible to do. you can be sure that whatever interface you take, it will send its data in a different way.
I'm sure that Ben is talking about having a common interface for things that objects have in common, and not for the things that they don't have in common. Just because the commonality can't be total doesn't mean it can't exist at all.
each unit has different resolutions, different amounts of i/o, and for that reason, a different protocol.
The commonality between objects may be increased by specifying that classes in particular should have a query interface in order to figure out how many sensors there are, how they are labeled if they are labeled, and what is the type and possible values of each sensor.
well, that is what the hid driver (in the os) does already by inspecting the report descriptors that the device sent during enumeration..... the question is just: is it planned to have, at some time, the [hid] object replaced by some more generic objects that use libusb instead and will decode this stuff on their own, or will the libusb stuff just an extension to it?
I think this sounds like a good grand plan, but would probably take a while to get there. If there was a USB HID object that received data in the Pd space and parsed it into [hid]-style messages, then it could be used in combo with a libusb object to replace [hid] in perhaps a more flexible way.
this is neccesarry because of the differencies in the devices. it is even possible that you take two different joysticks, and both pack their messages in completely different ways: one could put all info in just one report-descriptor, the other may use serveral of them, or even one for each axis/button.
Does this happen in practice? Do you have an actual situation where three joystick models do exactly that?
dont have any joysticks at all. but i have already seen two usb mice that use different "data layouts" to send the same information, so there is a chance ... altough im sure myself that most devices stick to some kind of "common sense" .... well, at least i hope that ....
I have 5 different mice from four different manufacturers and I can say that they all work fine with the [mouse] object. I don't know what is going on at the USB level, but I know that the data is coming out of the [mouse] object where its supposed to. The order in which the data gets outputted might be different tho.
.hc
________________________________________________________________________ ____
"Computer science is no more related to the computer than astronomy is related to the telescope." -Edsger Dykstra