Skip to contentSkip to conversation

Input Service support for phones

PATCH In review Daniel Gollub 2 participants 3 messages May 2, 2007 – May 4, 2007 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input Service support for phones

Hi,

attachted is a simple patch for the input service, which allows (again - changed since 3.9 release) using a phone as input device. Current code only allows devices with major class of "Peripheral" and "Fake Input" (Audio/Video).

best regards,
Daniel

device.c +22 -0
diff -u -p -r1.43 device.c
@@ -195,6 +195,28 @@ static const char *create_input_path(uin
 	static int next_id = 0;
 
 	switch (major) {
+	case 0x02: /* Phone */	
+		switch (minor) {
+		case 0x01: /* Cellular */
+			strcpy(subpath, "celluar");
+			break;
+		case 0x02: /* Cordless */	
+			strcpy(subpath, "cordless");
+			break;
+		case 0x03: /* Smart Phone */
+			strcpy(subpath, "smartphone");
+			break;
+		case 0x04: /* Modem */ 	
+			strcpy(subpath, "modem");
+			break;
+		case 0x05: /* ISDN */	
+			strcpy(subpath, "isdn");
+			break;
+		default:
+			strcpy(subpath, "phone");	
+			break;
+		}
+		break;
 	case 0x04: /* Audio */
 		switch (minor) {
 		/* FIXME: Testing required */

Index: input/manager.c
===================================================================
RCS file: /cvsroot/bluez/utils/input/manager.c,v
retrieving revision 1.22

manager.c +1 -0
diff -u -p -r1.22 manager.c
@@ -800,6 +800,7 @@ static DBusHandlerResult create_device(D
 
 	switch (cls & 0x1f00) {
 		case 0x0500: /* Peripheral */
+		case 0x0200: /* Phone */
 			if (get_handles(pr, pnp_uuid, pnp_handle_reply) < 0) {
 				pending_req_free(pr);
 				return err_not_supported(conn, msg);

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#1 lore raw

Hi Daniel,

Quoted 4 lines

attachted is a simple patch for the input service, which allows (again - changed since 3.9 release) using a phone as input device. Current code only allows devices with major class of "Peripheral" and "Fake Input" (Audio/Video).

a subpath == "phone" is fully enough. Don't make it more complicated than it needs to be.

Regards

Marcel

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#2 lore raw
Quoted 2 lines · Marcel Holtmann

a subpath == "phone" is fully enough. Don't make it more complicated than it needs to be.

full ack. Adapted patch attachted.

best regards,
Daniel

Index: input/device.c
===================================================================
RCS file: /cvsroot/bluez/utils/input/device.c,v
retrieving revision 1.43

device.c +3 -0
diff -u -p -r1.43 device.c
@@ -195,6 +195,9 @@ static const char *create_input_path(uin
 	static int next_id = 0;
 
 	switch (major) {
+	case 0x02: /* Phone */	
+		strcpy(subpath, "phone");	
+		break;
 	case 0x04: /* Audio */
 		switch (minor) {
 		/* FIXME: Testing required */

Index: input/manager.c
===================================================================
RCS file: /cvsroot/bluez/utils/input/manager.c,v
retrieving revision 1.22

manager.c +1 -0
diff -u -p -r1.22 manager.c
@@ -800,6 +800,7 @@ static DBusHandlerResult create_device(D
 
 	switch (cls & 0x1f00) {
 		case 0x0500: /* Peripheral */
+		case 0x0200: /* Phone */
 			if (get_handles(pr, pnp_uuid, pnp_handle_reply) < 0) {
 				pending_req_free(pr);
 				return err_not_supported(conn, msg);

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel