[libhid-discuss] Parsing hid_dump_tree()

Charles Lepple clepple at ghz.cc
Sat Mar 29 01:01:36 UTC 2008


On Mar 26, 2008, at 3:14 PM, comicinker wrote:
> Hi
>
> Can somebody give me a hint where I can start when I want to parse the
> hid_dump_tree()?

I wouldn't advise parsing the output of that function - instead, take  
a look at the hidparser code that hid_dump_tree() references.

> From another, cheaper mouse, the hid_dump_tree() looks like that:
>
>    [...]
>   path: 0x00010001.0x00010030; type: 0x80
>   path: 0x00010001.0x00010031; type: 0x80
> //(or kinda)
>    [...]

Apparently, it does not have the two outer collections that the other  
mouse has.

> Much shorter! But how can I directly generate my PATH_OUT[] from  
> it? Do
> I have to dive into hid_dump_tree()?

It looks like you may have to look at the tree.

(libhid was originally designed for HID PDC UPSes, which have fairly  
strict requirements on the format of the HID element tree - so a  
fixed path would work there.)

> AND: How can I get the RECV_PACKET_LEN for this address automatically?
> Or is it always the same length for each address (6)? The  
> test_libhid.c
> doesn't tell where this value is detected.


It is in the interface descriptor.

-- 
Charles Lepple






More information about the libhid-discuss mailing list