[libhid-discuss] Announce hidmon and some questions and remarks about libhid

Charles Lepple clepple at ghz.cc
Tue Jan 23 03:12:30 CET 2007


On Jan 22, 2007, at 7:11 PM, Frederik Reiß wrote:

> i am developing a small programm[0] to control my TFT display via the
> Monitor Control Class[1]. I use libhid for that job, and it works  
> great
> (but not perfect). It sould be able to control other HID compatible
> displays.

Hi Frederik,

looks cool! I tried writing a program to do this with libhid a while  
ago, but it turns out my Apple CRT had some issues with its report  
descriptor, and I sold the monitor before I made any real progress.

> Now i have some questions and remarks:
>
> Is there any way to get the needed buffer size for  
> hid_get_input_report
> and friends ?

I admit that I don't know much about the MGE HIDParser code - there  
should be a way to extract it from the parsed report structures that  
it creates, but I am not sure the exact syntax.

That function was meant for a device where the buffer size was known  
ahead of time.

> It would be nice if the functions which take a path as argument use
> somthing like the HIDPath struct (in hidtypes.h) instead of letting  
> the
> user play with ints !

I would actually prefer to see something along the lines of Apple's  
HID API, where you pass in "cookies" which are really hash values for  
the paths.

Granted, you would still need a HIDPath struct to determine the  
cookie, but it gets you closer to O(1) lookups when you need to find  
the report ID and offset.

> hid_get_item_value does not return a proper value for me (but all/some
> of the other fields in HIDInterface get filled correctly).

Please note the TODO items:

http://www.ghz.cc/~clepple/libhid/doc/html/ 
hid__exchange_8c.html#3d57558be35776185e33c4cdce3d6b19

Do you have an idea of what the value should look like? Are you sure  
the report descriptor is correct?

> if hid_get_item_value is called it seems that it passes the ? 
> parser? the
> size of the data in bits, but the parser wants the size in bytes,  
> which
> results in an warning.

Can you post the hex dump of the HID report descriptor, and some  
context for this error?

regards,

-- 
Charles Lepple




More information about the libhid-discuss mailing list