public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: BlueZ Hackers <bluez-devel@lists.sourceforge.net>
Subject: [Bluez-devel] [PATCH] Add some device types
Date: Wed, 05 Mar 2008 23:45:19 +0000	[thread overview]
Message-ID: <1204760719.2640.83.camel@cookie.hadess.net> (raw)

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

Heya,

A patch to add tablets and joypads/joysticks to client.c.

I'm currently reworking the device filter to suck a bit less.

Cheers

[-- Attachment #2: bluez-gnome-add-device-types.patch --]
[-- Type: text/x-patch, Size: 1977 bytes --]

Index: client.c
===================================================================
RCS file: /cvsroot/bluez/gnome/common/client.c,v
retrieving revision 1.41
diff -u -p -u -p -r1.41 client.c
--- client.c	11 Feb 2008 22:23:36 -0000	1.41
+++ client.c	5 Mar 2008 23:41:16 -0000
@@ -137,6 +137,10 @@ const gchar *bluetooth_type_to_string(gu
 		return N_("Camera");
 	case BLUETOOTH_TYPE_PRINTER:
 		return N_("Printer");
+	case BLUETOOTH_TYPE_JOYPAD:
+		return N_("Joypad");
+	case BLUETOOTH_TYPE_TABLET:
+		return N_("Tablet");
 	default:
 		return N_("Unknown");
 	}
@@ -163,15 +167,28 @@ static guint class_to_type(guint32 class
 	case 0x04:
 		switch ((class & 0xfc) >> 2) {
 		case 0x01:
+		case 0x02:
 			return BLUETOOTH_TYPE_HEADSET;
 		}
 		break;
 	case 0x05:
 		switch ((class & 0xc0) >> 6) {
+		case 0x00:
+			switch ((class & 0x1e) >> 2) {
+			case 0x01:
+			case 0x02:
+				return BLUETOOTH_TYPE_JOYPAD;
+			}
+			break;
 		case 0x01:
 			return BLUETOOTH_TYPE_KEYBOARD;
 		case 0x02:
-			return BLUETOOTH_TYPE_MOUSE;
+			switch ((class & 0x1e) >> 2) {
+			case 0x05:
+				return BLUETOOTH_TYPE_TABLET;
+			default:
+				return BLUETOOTH_TYPE_MOUSE;
+			}
 		}
 		break;
 	case 0x06:
Index: client.h
===================================================================
RCS file: /cvsroot/bluez/gnome/common/client.h,v
retrieving revision 1.23
diff -u -p -u -p -r1.23 client.h
--- client.h	11 Feb 2008 22:23:36 -0000	1.23
+++ client.h	5 Mar 2008 23:41:16 -0000
@@ -86,10 +86,12 @@ enum {
 	BLUETOOTH_TYPE_KEYBOARD   = 1 << 6,
 	BLUETOOTH_TYPE_MOUSE      = 1 << 7,
 	BLUETOOTH_TYPE_CAMERA     = 1 << 8,
-	BLUETOOTH_TYPE_PRINTER    = 1 << 9 
+	BLUETOOTH_TYPE_PRINTER    = 1 << 9,
+	BLUETOOTH_TYPE_JOYPAD     = 1 << 10,
+	BLUETOOTH_TYPE_TABLET     = 1 << 11,
 };
 
-#define BLUETOOTH_TYPE_NUM_TYPES 10
+#define BLUETOOTH_TYPE_NUM_TYPES 12
 #define BLUETOOTH_TYPE_INPUT (BLUETOOTH_TYPE_KEYBOARD | BLUETOOTH_TYPE_MOUSE)
 
 const gchar *bluetooth_type_to_string(guint type);

[-- Attachment #3: Type: text/plain, Size: 228 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

             reply	other threads:[~2008-03-05 23:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-05 23:45 Bastien Nocera [this message]
2008-03-06 10:54 ` [Bluez-devel] [PATCH] Add some device types Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1204760719.2640.83.camel@cookie.hadess.net \
    --to=hadess@hadess.net \
    --cc=bluez-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox