Page MenuHomeFreeBSD

D2229.id4682.diff
No OneTemporary

D2229.id4682.diff

Index: usr.sbin/bluetooth/bthidd/hid.c
===================================================================
--- usr.sbin/bluetooth/bthidd/hid.c
+++ usr.sbin/bluetooth/bthidd/hid.c
@@ -165,9 +165,21 @@
continue;
page = HID_PAGE(h.usage);
- usage = HID_USAGE(h.usage);
val = hid_get_data(data, &h);
+ /*
+ * When the input field is an array and the usage is specified
+ * with a range instead of an ID, we have to derive the actual
+ * usage by using the item value as an index in the usage range
+ * list.
+ */
+ if ((h.flags & HIO_VARIABLE)) {
+ usage = HID_USAGE(h.usage);
+ } else {
+ const uint32_t usage_offset = val - h.logical_minimum;
+ usage = HID_USAGE(h.usage_minimum + usage_offset);
+ }
+
switch (page) {
case HUP_GENERIC_DESKTOP:
switch (usage) {

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 25, 3:28 PM (11 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32122123
Default Alt Text
D2229.id4682.diff (804 B)

Event Timeline