[PATCH BlueZ 08/13] hog: Handle feature reports

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch writes the feature reports coming from the HID host on the
device's Feature Report characteristic.
---
 profiles/input/hog_device.c |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/profiles/input/hog_device.c b/profiles/input/hog_device.c
index 236745a..00127c3 100644
--- a/profiles/input/hog_device.c
+++ b/profiles/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"
 
@@ -362,10 +363,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)
@@ -409,6 +420,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:
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux