[libhid-discuss] cross-platform capabilities?

Charles Lepple clepple at ghz.cc
Thu Apr 5 14:02:11 UTC 2007


nescivi wrote:
> So my question is: in how far is libhid already usable in a cross platform
> context?

Short answer: if libusb can access the device without interference from
any kernel HID drivers (e.g. FreeBSD after unloading or de-configuring
uhid; Linux after detaching the kernel usbhid driver, or OS X if nothing
else is using the native HID API), then libhid should be able to access
the device.

Specifically, in OS X, there is no way to claim exclusive control over the
device if the kernel HID module has already claimed it. (You can write a
custom stub driver with higher precedence than the kernel driver.)

FreeBSD 6.2 seems to have the ugen driver compiled into the kernel, so you
need to remove that from GENERIC and rebuild.

At the moment, there is no Win32 backend, but you might have some luck
with libusb-win32 and libhid.

As far as sending data, libhid originally had some code to send data on
the control endpoint, but I think that is currently broken. Shouldn't be
too hard to add back in, though -- that functionality is in an early
version of libhid in Network UPS Tools -
http://www.networkupstools.org/source.html

libhid also includes a function to send data over an interrupt endpoint.

-- 
Charles Lepple
clepple at ghz.cc




More information about the libhid-discuss mailing list