Make sure to only pickup hid_input items when parsing input reports.

As it turns out, libusbhid(3) also picks up hic_collection items even
though we explicitly requested hid_input items only.

Tested by:	Buganini < buganini at gmail dot com >
MFC after:	1 week
This commit is contained in:
Maksim Yevmenkin 2010-09-08 20:00:27 +00:00
parent 87ff4bceb6
commit fc780ca17e

View File

@ -160,7 +160,8 @@ hid_interrupt(bthid_session_p s, uint8_t *data, int32_t len)
for (d = hid_start_parse(hid_device->desc, 1 << hid_input, -1);
hid_get_item(d, &h) > 0; ) {
if ((h.flags & HIO_CONST) || (h.report_ID != report_id))
if ((h.flags & HIO_CONST) || (h.report_ID != report_id) ||
(h.kind != hid_input))
continue;
page = HID_PAGE(h.usage);