aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Paulo Rechi Vita <jprvita@openbossa.org>2012-06-20 21:34:36 -0300
committerJoão Paulo Rechi Vita <jprvita@openbossa.org>2012-06-21 18:00:18 -0300
commitf7f467e2bb3be971a0d93b29d64951a943a72dfc (patch)
tree916767b2db28964237c453d46eab132277a29506
parent7180fe94b4774447c5873798e5b91978be34cdb6 (diff)
downloadbluez-f7f467e2bb3be971a0d93b29d64951a943a72dfc.tar.gz
bluez-f7f467e2bb3be971a0d93b29d64951a943a72dfc.tar.xz
bluez-f7f467e2bb3be971a0d93b29d64951a943a72dfc.zip
hog: Handle feature reports
This patch writes the feature reports coming from the HID host on the device's Feature Report characteristic.
-rw-r--r--input/hog_device.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/input/hog_device.c b/input/hog_device.c
index 374f9fed..3876d98c 100644
--- a/input/hog_device.c
+++ b/input/hog_device.c
@@ -56,6 +56,7 @@
#define HOG_REPORT_TYPE_INPUT 1
#define HOG_REPORT_TYPE_OUTPUT 2
+#define HOG_REPORT_TYPE_FEATURE 3
#define UHID_DEVICE_FILE "/dev/uhid"
@@ -366,10 +367,20 @@ static void forward_report(struct hog_device *hogdev,
int size;
guint type;
- type = HOG_REPORT_TYPE_OUTPUT;
data = ev->u.output.data;
size = ev->u.output.size;
+ switch (ev->type) {
+ case UHID_OUTPUT:
+ type = HOG_REPORT_TYPE_OUTPUT;
+ break;
+ case UHID_FEATURE:
+ type = HOG_REPORT_TYPE_FEATURE;
+ break;
+ default:
+ return;
+ }
+
l = g_slist_find_custom(hogdev->reports, GUINT_TO_POINTER(type),
report_type_cmp);
if (!l)
@@ -413,6 +424,7 @@ static gboolean uhid_event_cb(GIOChannel *io, GIOCondition cond,
switch (ev.type) {
case UHID_OUTPUT:
+ case UHID_FEATURE:
forward_report(hogdev, &ev);
break;
case UHID_OUTPUT_EV: