* [Bluez-devel] [PATCH] Add some device types
@ 2008-03-05 23:45 Bastien Nocera
2008-03-06 10:54 ` Marcel Holtmann
0 siblings, 1 reply; 2+ messages in thread
From: Bastien Nocera @ 2008-03-05 23:45 UTC (permalink / raw)
To: BlueZ Hackers
[-- 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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Bluez-devel] [PATCH] Add some device types
2008-03-05 23:45 [Bluez-devel] [PATCH] Add some device types Bastien Nocera
@ 2008-03-06 10:54 ` Marcel Holtmann
0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2008-03-06 10:54 UTC (permalink / raw)
To: BlueZ development
Hi Bastien,
> A patch to add tablets and joypads/joysticks to client.c.
patch has been applied. Thanks.
> I'm currently reworking the device filter to suck a bit less.
Great.
Regards
Marcel
-------------------------------------------------------------------------
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/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-03-06 10:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-05 23:45 [Bluez-devel] [PATCH] Add some device types Bastien Nocera
2008-03-06 10: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