Blame SOURCES/0002-autopair-Don-t-handle-the-iCade.patch

2b7b48
From c16ae7041c7511d8d1ed8441f696716fa6a9117e Mon Sep 17 00:00:00 2001
2b7b48
From: Bastien Nocera <hadess@hadess.net>
2b7b48
Date: Tue, 19 Nov 2013 14:11:39 +0100
2b7b48
Subject: [PATCH 2/5] autopair: Don't handle the iCade
2b7b48
2b7b48
We can't easily enter digits other than 1 through 4 (inclusive)
2b7b48
so leave it up to the agent to figure out a good passcode
2b7b48
for the iCade.
2b7b48
2b7b48
Note that we can not use the VID/PID of the device, as it is not
2b7b48
yet known at that point.
2b7b48
---
2b7b48
 plugins/autopair.c | 12 +++++++++++-
2b7b48
 1 file changed, 11 insertions(+), 1 deletion(-)
2b7b48
2b7b48
diff --git a/plugins/autopair.c b/plugins/autopair.c
2b7b48
index 8c98c12..5d2f6f7 100644
2b7b48
--- a/plugins/autopair.c
2b7b48
+++ b/plugins/autopair.c
2b7b48
@@ -57,13 +57,23 @@ static ssize_t autopair_pincb(struct btd_adapter *adapter,
2b7b48
 {
2b7b48
 	char addr[18];
2b7b48
 	char pinstr[7];
2b7b48
+	char name[25];
2b7b48
 	uint32_t class;
2b7b48
 
2b7b48
 	ba2str(device_get_address(device), addr);
2b7b48
 
2b7b48
 	class = btd_device_get_class(device);
2b7b48
 
2b7b48
-	DBG("device %s 0x%x", addr, class);
2b7b48
+	device_get_name(device, name, sizeof(name));
2b7b48
+	name[sizeof(name) - 1] = 0;
2b7b48
+
2b7b48
+	DBG("device %s (%s) 0x%x", addr, name, class);
2b7b48
+
2b7b48
+	g_message ("vendor 0x%X product: 0x%X", btd_device_get_vendor (device), btd_device_get_product (device));
2b7b48
+
2b7b48
+	/* The iCade shouldn't use random PINs like normal keyboards */
2b7b48
+	if (name != NULL && strstr(name, "iCade") != NULL)
2b7b48
+		return 0;
2b7b48
 
2b7b48
 	/* This is a class-based pincode guesser. Ignore devices with an
2b7b48
 	 * unknown class.
2b7b48
-- 
2b7b48
1.8.4.2
2b7b48