[libhid-discuss] cross-platform capabilities?

Charles Lepple clepple at ghz.cc
Thu Apr 5 15:28:37 UTC 2007


nescivi wrote:
> Hi,
>
> On Thursday 05 April 2007 16:44, Charles Lepple wrote:
>> Xiaofan Chen wrote:
>> > On 4/5/07, Charles Lepple <clepple at ghz.cc> wrote:
>> >> 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.)
>> >
>> > Why not use the native Mac OS X HID and use it as backend for
>> > libhid and get rid of the libusb dependency.
>>
>> No objections from me. I just don't have the time to write and test the
>> code.
>
> From what I have seen with code using the native OSX HID interface, it
> somehow
> does not see all the LEDs that are available from the descriptor, which is
> one reason, why I would want to get away from the native implementation.
> If the Mac OSX native implementation would be clean, I would not have so
> much
> of a problem with it, but from my experience, it seems it is not so
> clean...
> Note: I have not really programmed with their HID interface, just have
> worked
> with programs that use it, and seem to have the mentioned problem.

I should stress that when I talk about adding native HID interfaces to
libhid, I intend them to be strictly optional. There are many situations
like what you describe, where things don't work as well with one
particular interface. Many devices do not respond the same way to the
control-out and interrupt-out methods of setting a report, for instance.

Ideally, programs linked against libhid would be able to select a backend
API at runtime, on a per-device/interface level.

-- 
Charles Lepple
clepple at ghz.cc




More information about the libhid-discuss mailing list