[libhid-discuss] Using multiple HID devices with same vendor / product ID
Charles Lepple
clepple at ghz.cc
Sun Nov 16 16:20:51 UTC 2008
On Nov 16, 2008, at 10:01 AM, Sarah Mount wrote:
> Is it actually possible to do what I'm trying to do from the Python
> bindings? Presumably I need to subclass HIDInterfaceMatcher
Subclassing is the Python way, but HIDInterfaceMatcher is a C struct
wrapped by SWIG, not a full-fledged Python class.
> to manipulate the internal list of matched devices, but will this
> have to
> be done in the C library and if so where would be best to start
> looking -- hid_opening.c or linux.c?
Looks like it's there in the SVN version:
http://libhid.alioth.debian.org/doc/hid__opening_8c-source.html#l00109
I almost forgot - someone finally contributed code to do just that.
You might be breaking new ground with that, though - I don't know if
that code has been tested much in Python.
My advice would be to open all of the devices sequentially in an
initialization function, and not to spawn off any new threads until
after you have opened the devices. (I don't think thread safety was
considered there.)
--
Charles Lepple
More information about the libhid-discuss
mailing list