Thread (3 messages) read the whole thread 3 messages, 2 authors, 2012-11-23
STALE4997d

[PATCH BlueZ 2/2] hog: Fix output report

From: Vinicius Costa Gomes <hidden>
Date: 2012-11-23 19:08:29
Subsystem: the rest · Maintainer: Linus Torvalds

Even if we receive the output report with the report id included, we
must send the output report without the report id, as the remote side
is able to infer it using the handle.
---
 profiles/input/hog_device.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/profiles/input/hog_device.c b/profiles/input/hog_device.c
index 994437f..0a5fb58 100644
--- a/profiles/input/hog_device.c
+++ b/profiles/input/hog_device.c
@@ -549,8 +549,13 @@ static void forward_report(struct hog_device *hogdev,
 	int size;
 	guint type;
 
-	data = ev->u.output.data;
-	size = ev->u.output.size;
+	if (hogdev->prepend_id) {
+		data = ev->u.output.data + 1;
+		size = ev->u.output.size - 1;
+	} else {
+		data = ev->u.output.data;
+		size = ev->u.output.size;
+	}
 
 	switch (ev->type) {
 	case UHID_OUTPUT:
-- 
1.8.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help