[libhid-discuss] Report Description Question (Not Matching lsusb)

Christopher Moore christopher at bnmintl.com
Fri Oct 3 10:54:40 UTC 2008


Thanks again.  I'll try out that .c code and also take a look at that 
python script.



Charles Lepple wrote:
> On Oct 2, 2008, at 8:36 PM, Christopher Moore wrote:
>
>> Hello,
>>
>> I'm trying to get some output from hid_dump_tree and I can't seem to get
>> anything meaningful out of it.  For example, in one of the older posts
>> on this mailing list, I managed to see output like the following:
>>
>> TRACE: hid_dump_tree(): iterating the parse tree for USB device 
>> 001/003[0]...
>> parse tree of HIDInterface 001/003[0]:
>>   path: 0x00010009.0x00010033; type: 0x80
>>   path: 0x00010009.0x00010034; type: 0x80
>> ...
>>
>> while, I can only recieve this:
>>
>> TRACE: hid_reset_parser(): resetting the HID parser for USB device 
>> 002/005[3]...
>>   TRACE: hid_prepare_parser(): dumping the raw report descriptor
>>   TRACE: hid_prepare_parser(): 0x000: 0x05
>
> Please try the C test_libhid.c program first - the Python interface is 
> newer, and may have hidden bugs.
>
>> -------------------
>>
>> the code being used (Python):
>>
>> hid_set_debug(HID_DEBUG_ALL)
>> hid_set_debug_stream(sys.stderr)
>> hid_set_usb_debug(0)
>>
>> ret = hid_init()
>> if ret != HID_RET_SUCCESS:
>>   sys.stderr.write("hid_init failed with return code %d.\n" % ret)
>>
>> hid = hid_new_HIDInterface()
>> matcher = HIDInterfaceMatcher()
>> matcher.vendor_id = 0x13b1
>> matcher.product_id = 0x001d
>>
>> ret = hid_force_open(hid, 3, matcher, 3)
>> ret = hid_dump_tree(sys.stdout, hid);
>>
>> ---------------------
>>
>> I'm after Interface #3 (the hid device).
>
>
> I would also take a look at the hidwrap.py high-level wrapper around 
> the SWIG-generated code. The hidwrap.py interface is more 
> object-oriented, and hides some of the C heritage of the code.
>




More information about the libhid-discuss mailing list