Linux bluetooth development
 help / color / mirror / Atom feed
From: Denis KENZIOR <denis.kenzior@trolltech.com>
To: bluez-devel@lists.sourceforge.net
Subject: [Bluez-devel] Patch: GetRemoteClass
Date: Tue, 1 Aug 2006 13:29:02 +1000	[thread overview]
Message-ID: <200608011329.03106.denis.kenzior@trolltech.com> (raw)

[-- 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

             reply	other threads:[~2006-08-01  3:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-01  3:29 Denis KENZIOR [this message]
2006-08-02  3:13 ` [Bluez-devel] Patch: GetRemoteClass Marcel Holtmann
2006-08-02 11:04   ` Peter Wippich
2006-08-09 22:09     ` 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=200608011329.03106.denis.kenzior@trolltech.com \
    --to=denis.kenzior@trolltech.com \
    --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