[libhid-discuss] Re: Usage Path on interface zero?

Charles Lepple clepple at ghz.cc
Fri Nov 3 05:03:40 CET 2006


[Please re-subscribe to libhid-discuss at lists.alioth.debian.org -  
the ailab.ch list is obsolete.

URL: http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss

- Charles ]

On Oct 30, 2006, at 1:48 PM, David Wuertele wrote:

> I'm confused about finding "usage path" for libhid.  First of all,
> I've never seen the term "usage path" used anywhere in the USB
> standard --- I've seen "usage page" and "usage" but no "path".  Is
> this term invented for libhid?

I think it originally came about in the MGE HID parser, but you're  
probably right that it is not in the HID spec.

All we are doing is concatenating the main collection Usage Page/ 
Usage (hereafter just "usage code", since the Usage Page is really  
just shorthand for representing the top 16 bits of the Usage) with  
the usage code for each of the sub-collections.

As you can see, this API is geared towards devices with many nested  
collections (such as Power-Device Class UPSes).

> Also, I thought that Usage Page and Usage were only required by the
> application to interpret results from the device.

Correct, if you know the report ID. Report IDs for standard usage  
codes may vary between device manufacturers.

> None of the packets
> defined for transmitting to USB devices have fields for Usage Page or
> Usage.  Why does libhid need the Usage Path in order to send data to a
> device?  Isn't the bmRequestType, bRequest, bValue, bIndex, and
> wLength enough to specify a write to the device?

You are free to use libhid calls as well, if your application does  
not need a more complex interface.

> But here's my most pressing libhid question: I see that the
> test_libhid.c program describes how to find the usage path by finding
> the Usage Page and the Usage in lsub -vvv.  But what if I want to
> write to interface zero?  lsusb does not print out the report
> descriptors for interface zero, so I do not know what the usages are.
> Is there a default report descriptor for interface zero, and where can
> I find it?

Are you sure it's not just a permissions problem? In order to  
retrieve HID Report descriptors with 'lsusb -vvv', you need write  
access to the device, and you may have to detach the kernel driver  
first (I forget, it's been a while since I set this up from scratch).

-- 
Charles Lepple
clepple at ghz.cc





More information about the libhid-discuss mailing list