[libhid-discuss] Interface parameter

Adrian Parker adrian.l.parker at gmail.com
Mon May 26 16:15:53 UTC 2008


I'm receiving some, but not all replies sent to me.  The ones I'm missing
are not showing up in my Gmail Spam filter, but I do see them in the
archives.

On Fri, May 23, 2008 at 03:49:22PM -0400, Adrian Parker wrote:
> >

> > I've noticed that run on Windows, the function hid_force_open ignores
the
interface parameter and always (and only) opens the first interface of each
device on each bus (which pretty much means the matcher parameter can't be
used reliably to match against bInterfaceClasses).  You can set the
interface parameter to non-valid values and it still works (setting it to 0
or 50,000, the function acts the same way).

> > Perhaps I'm mistaken as to what the third parameter of the following
does?
hid_return hid_force_open(HIDInterface* const hidif, int const config, int
const interface, HIDInterfaceMatcher const* const matcher, unsigned short
retries);  // hid.h

> > If not, perhaps its just broken on Windows.


On *Sat May 24 12:32:40 UTC 2008, Peter wrote:*

On Fri, May 23, 2008 at 03:49:22PM -0400, Adrian Parker wrote:
> > >* If not, perhaps its just broken on Windows.
*
> > Please send the code.


Send what code?  I'm using the example (
http://svn.debian.org/wsvn/libhid/trunk/test/lshid.c?op=file&rev=0&sc=0).

When you call hid_force_open, the third parameter (a callback function), is
only called once for each device.  I guess I could iterate through the
various interfaces then and there, but that seems a bit awkward.

In the same example, in device_iterator, they check to see if the current
device has already been seen, that seems a bit odd though as the callback
method is only called once for each device (Evne devices with multiple
interfaces).


Adrian


More information about the libhid-discuss mailing list