Linux bluetooth development
 help / color / mirror / Atom feed
* [Bluez-devel] Patch: GetRemoteClass
@ 2006-08-01  3:29 Denis KENZIOR
  2006-08-02  3:13 ` Marcel Holtmann
  0 siblings, 1 reply; 4+ messages in thread
From: Denis KENZIOR @ 2006-08-01  3:29 UTC (permalink / raw)
  To: bluez-devel

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

All,

Attached is a patch to get remote class of device information as a uint32.  
This introduces a new method with signature:
uint32 GetRemoteClass(string address), which returns the class of device 
information encoded as a 32 bit integer.

The reasoning is that some applications might want to rely on their own 
conversion routines for the Major, Minor and Service class attributes, and 
thus the DBUS GetRemoteMajorClass, GetRemoteMinorClass, etc methods that 
return strings are not useful.

Thoughts?

-Denis



[-- Attachment #2: bluez.patch --]
[-- Type: text/x-diff, Size: 2227 bytes --]

Index: dbus-adapter.c
===================================================================
RCS file: /cvsroot/bluez/utils/hcid/dbus-adapter.c,v
retrieving revision 1.67
diff -u -r1.67 dbus-adapter.c
--- dbus-adapter.c	26 Jul 2006 13:57:50 -0000	1.67
+++ dbus-adapter.c	1 Aug 2006 03:24:10 -0000
@@ -1276,6 +1276,26 @@
 	return send_reply_and_unref(conn, reply);
 }
 
+static DBusHandlerResult handle_dev_get_remote_class_req(DBusConnection *conn,
+								DBusMessage *msg,
+								void *data)
+{
+	DBusMessage *reply;
+	uint32_t class;
+
+	if (get_remote_class(conn, msg, data, &class) < 0)
+		return DBUS_HANDLER_RESULT_HANDLED;
+
+	reply = dbus_message_new_method_return(msg);
+	if (!reply)
+		return DBUS_HANDLER_RESULT_NEED_MEMORY;
+
+	dbus_message_append_args(reply, DBUS_TYPE_UINT32, &class,
+					DBUS_TYPE_INVALID);
+
+	return send_reply_and_unref(conn, reply);
+}
+
 static DBusHandlerResult handle_dev_get_remote_name_req(DBusConnection *conn, DBusMessage *msg, void *data)
 {
 	char filename[PATH_MAX + 1];
@@ -2333,6 +2353,7 @@
 	{ "GetRemoteMajorClass",			handle_dev_get_remote_major_class_req	},
 	{ "GetRemoteMinorClass",			handle_dev_get_remote_minor_class_req	},
 	{ "GetRemoteServiceClasses",			handle_dev_get_remote_service_cls_req	},
+	{ "GetRemoteClass",				handle_dev_get_remote_class_req		},
 	{ "GetRemoteName",				handle_dev_get_remote_name_req		},
 	{ "GetRemoteAlias",				handle_dev_get_remote_alias_req		},
 	{ "SetRemoteAlias",				handle_dev_set_remote_alias_req		},
Index: dbus-api.txt
===================================================================
RCS file: /cvsroot/bluez/utils/hcid/dbus-api.txt,v
retrieving revision 1.39
diff -u -r1.39 dbus-api.txt
--- dbus-api.txt	26 Jun 2006 12:33:13 -0000	1.39
+++ dbus-api.txt	1 Aug 2006 03:24:10 -0000
@@ -461,6 +461,14 @@
 			Possible errors: org.bluez.Error.InvalidArguments
 			                 org.bluez.Error.NotAvailable
 
+		uint32 GetRemoteClass(string address)
+
+			Get the remote major, minor, and service classes 
+			encoded as 32 bit integer.
+
+			Possible errors: org.bluez.Error.InvalidArguments
+					 org.bluez.Error.NotAvailable
+
 		string GetRemoteName(string address)
 
 			Get adapter name for a remote device. This request

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

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- 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] 4+ messages in thread

end of thread, other threads:[~2006-08-09 22:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-01  3:29 [Bluez-devel] Patch: GetRemoteClass Denis KENZIOR
2006-08-02  3:13 ` Marcel Holtmann
2006-08-02 11:04   ` Peter Wippich
2006-08-09 22:09     ` Marcel Holtmann

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