Discussion:
[libhid-discuss] hidparser - development
Skip Hodgson
2010-09-18 22:38:52 UTC
Permalink
I notice this discussion list does not seem very active. Does this mean
the libhid project development is dormant? I ask this because there
seem to be some discrepancies in the hidparser and I don't know whether
a new one is under development or whether it matters to anyone any
more. There are a number of characteristics in the HID spec (version
1.11) which don't seem to be in the parser (at revision 364).
Specifically at least the Local Items "Usage Minimum" and "Usage
Maximum" are not recognized. These are used by a number of existing
devices so the deficiency is noticeable. I have developed a little
patch to deal with these for our own project but I would like to know if
further development is under way or if I have just misunderstood the
spec. or the project.

Cheers,
Skip.
Charles Lepple
2010-09-19 16:04:59 UTC
Permalink
Post by Skip Hodgson
I notice this discussion list does not seem very active. Does this
mean the libhid project development is dormant? I ask this because
there seem to be some discrepancies in the hidparser and I don't
know whether a new one is under development or whether it matters to
anyone any more. There are a number of characteristics in the HID
spec (version 1.11) which don't seem to be in the parser (at
revision 364). Specifically at least the Local Items "Usage
Minimum" and "Usage Maximum" are not recognized. These are used by
a number of existing devices so the deficiency is noticeable. I
have developed a little patch to deal with these for our own project
but I would like to know if further development is under way or if I
have just misunderstood the spec. or the project.
You're right that there are Usage Minimum and Usage Maximum items in
the spec, and I thought that they were handled in some rudimentary
fashion. The debug routines that dump the parsed information don't
handle them well at all, though.

There are several use cases for HID which don't really overlap, and
libhid (and the hidparser code) were designed to work with the fairly
deep HID structure of an UPS (hence the "path" concept) rather than
the shallow structure of a mouse or keyboard (the latter of which will
often have Usage Minimum and Usage Maximum to span the range of key
scan codes).

Most _human_ interface devices (mouse, keyboard, etc., as opposed to
non-interface devices that just piggy-back on the HID protocol
definitions) are already handled by the OS HID drivers, so the
hidparser code is a little redundant in those situations.

Then, there's the license situation: hidparser is GPL (not LGPL),
which is a showstopper for people who want to use libhid and/or
hidparser in closed-source projects.

That said, it sounds like you've found enough of a use case to warrant
a patch, and you are more than welcome to post the patch to the list
(gzipped if it's larger than a few kB).
Skip Hodgson
2010-09-19 23:26:35 UTC
Permalink
The HID Spec document that we have on hand is so poorly written that it
is nearly incomprehensible. Thus we are trying to use libhid (and
libusb) and some commercially available devices to discover what the HID
spec actually is! We will need a fairly "deep structure" as you put it
for our flight simulation console but the example joysticks and
MicroChip boards exhibit this Usage Min/Max characteristic so it helps
if we can parse the report descriptors accurately.

I am attaching the patch we use in case somebody else needs it. I hope
that is the correct way to "post the patch". It runs OK in Linux with
gcc but I have no idea about the other operating systems you try to
support. We apply it from the libhid package directory by doing patch
-p0 <libhid_usageminmax.patch.

Hope this is helpful.

Skip.
Post by Charles Lepple
That said, it sounds like you've found enough of a use case to warrant
a patch, and you are more than welcome to post the patch to the list
(gzipped if it's larger than a few kB).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libhid_usageminmax.patch.gz
Type: application/x-gzip
Size: 1686 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20100920/686fa6be/attachment.bin>
Loading...