[libhid-discuss] Linux: the device is opened exclusively

Charles Lepple clepple at ghz.cc
Thu Jan 8 00:23:58 UTC 2009


[Please subscribe to the list. Thanks.]

On Jan 7, 2009, at 11:48 AM, Lux Vampere wrote:

> Hi,
>
> I have a problem with a driver that I am porting from Mac OS X to  
> Linux. The idea of the driver is that it should be able to send  
> some reports to a device, and then let the device answer by  
> broadcasting its (key) events to the system.

So the device acts like a keyboard?

> On Mac OS X, a force open is done, then a set report. The device  
> receives the data and then answers by broadcasting its key events,  
> which is what is wanted. The device is not opened exclusively.

This may be version-specific - I have seen cases where the system  
will not let you send to a device that you haven't opened exclusively.

> On Linux, the same code does not work: the device receives the data  
> but it does not answer (I have sniffed and the communication is  
> correct). It only answers if an interrupt read is done, and in this  
> case the data is not broadcasted, it is only available in the  
> driver and not outside. It is as if the device was opened  
> exclusively (seized).
>
> Is there a way to tell the library not to seize a device? Or is  
> there a way to solve my problem?

You have the source code - it is certainly possible.

Whether or not it produces the results you are looking for is up in  
the air. It probably depends on what the Linux kernel lets you do if  
you have not claimed the device.

-- 
Charles Lepple



More information about the libhid-discuss mailing list