public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix Apple Wireless keyboard pairing?
@ 2008-10-15  1:06 Bastien Nocera
  2008-10-15 15:20 ` Marcel Holtmann
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Bastien Nocera @ 2008-10-15  1:06 UTC (permalink / raw)
  To: BlueZ development

[-- Attachment #1: Type: text/plain, Size: 200 bytes --]

Heya,

If anyone has an Apple Wireless keyboard to test pairing against. I
believe the attached patch to be correct. Otherwise Apple keyboards
(which use the same OUI) will get a PIN of 0000.

Cheers

[-- Attachment #2: bluez-apple-wireless-kbd.patch --]
[-- Type: text/x-patch, Size: 715 bytes --]

diff --git a/wizard/main.c b/wizard/main.c
index 0854913..0340063 100644
--- a/wizard/main.c
+++ b/wizard/main.c
@@ -62,9 +62,10 @@ static gboolean pincode_callback(DBusGMethodInvocation *context,
 	const char *pincode = target_pincode;
 	gchar *text;
 
-	/* Apple Wireless and Mighty Mouse */
-	if (g_str_has_prefix(target_address, "00:0A:95:") == TRUE ||
-			g_str_has_prefix(target_address, "00:14:51:") == TRUE)
+	/* Apple Wireless and Mighty Mouse, and just the mice */
+	if ((g_str_has_prefix(target_address, "00:0A:95:") == TRUE ||
+			g_str_has_prefix(target_address, "00:14:51:") == TRUE) &&
+	    target_type == BLUETOOTH_TYPE_MOUSE)
 		pincode = "0000";
 
 	/* Most headsets are using 0000 as pincode */

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-10-23  4:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-15  1:06 [PATCH] Fix Apple Wireless keyboard pairing? Bastien Nocera
2008-10-15 15:20 ` Marcel Holtmann
2008-10-15 18:40 ` Mario Limonciello
     [not found] ` <48F63904.6090902@dell.com>
2008-10-15 21:32   ` Bastien Nocera
2008-10-15 21:41     ` Mario Limonciello
2008-10-23  4:54       ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox