[libhid-discuss] HID Usage path
Jorgen Lundman
lundman at lundman.net
Fri Jun 22 00:14:09 UTC 2007
This is probably a common question by now :) I think it would help if
you provided the output of hid_dump_tree() in test_hid.c, since "lsusb"
is a Linux only command. (right?)
Anyway, when dumping the device I am interested in, I get:
device identification of HIDInterface 005/007-6993-b001-00-00[0]:
dev_handle: 0x00302c00
device: 0x01808a00
location: 005/007-6993-b001-00-00
manufacturer: Yealink Network Technology Ltd.
product: VOIP USB Phone
parse tree of HIDInterface 005/007-6993-b001-00-00[0]:
path: 0x000b0001.0x00000000; type: 0x80
path: 0x000b0001.0x00000000; type: 0x80
path: 0x000b0001.0x00000000; type: 0x80
[big cut]
path: 0x000b0001.0x00000000; type: 0x80
path: 0x000b0001.0x00000000; type: 0x80
path: 0x000b0001.0x00000000; type: 0x90
path: 0x000b0001.0x00000000; type: 0x90
path: 0x000b0001.0x00000000; type: 0x90
path: 0x000b0001.0x00000000; type: 0x90
path: 0x000b0001.0x00000000; type: 0x90
path: 0x000b0001.0x00000000; type: 0x90
path: 0x000b0001.0x00000000; type: 0x90
[cut]
Now, test_hid.c seems to imply it should be of length 3, not 2. But
someone else on this list showed using just 2. Another email said to
ignore those ending with 0000's. Except all my 0x80 and 0x90 end in 0000's.
Am I right to use:
#define PATHLEN 2
int const PATH_IN[PATHLEN] = { 0x000b0001, 0x00000000 };
int const PATH_OUT[PATHLEN] = { 0x000b0001, 0x00000000 };
Sending the 6 test bytes at least say:
TRACE: hid_set_output_report(): sending report ID 0x00 (length: 6) to
USB device 005/007-6993-b001-00-00[0]...
NOTICE: hid_set_output_report(): successfully sent report to USB
device 005/007-6993-b001-00-00[0].
Finally, is this something static and specific to a device? Can I safely
embed this value in my sources, or am I supposed to scan for it each
time as it is dynamic?
Good news is that libhid appears to run rather well on OsX. Even though
I do get some warnings about untested code. That it manages to claim the
device is much further than I got with libusb.
Lund
--
Jorgen Lundman | <lundman at lundman.net>
Unix Administrator | +81 (0)3 -5456-2687 ext 1017 (work)
Shibuya-ku, Tokyo | +81 (0)90-5578-8500 (cell)
Japan | +81 (0)3 -3375-1767 (home)
More information about the libhid-discuss
mailing list