All of lore.kernel.org
 help / color / mirror / Atom feed
* [BlueZ v3 00/10] gdbus: Better D-Bus introspection
@ 2012-04-27 21:14 Lucas De Marchi
  2012-04-27 21:14 ` [BlueZ v3 01/10] gdbus: return if method signature is malformed Lucas De Marchi
                   ` (10 more replies)
  0 siblings, 11 replies; 15+ messages in thread
From: Lucas De Marchi @ 2012-04-27 21:14 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Lucas De Marchi

This series improves D-Bus introspection in gdbus to ease the life of people
using our interface: they can rely on binding generator available for QT, GTK
and others.

We are doing basically 3 things:

 - Adding the name of the arguments in methods and signals
 - Adding some annotations:
 	- deprecated
	- no-reply
 - Constifying the tables

First two patches were only 2 easy fixes during the development

Lucas De Marchi (10):
  gdbus: return if method signature is malformed
  gdbus: do not call memset for terminating NUL
  gdbus: save copy of undecorated signature
  gdbus: use argument name in method introspection
  gdbus: add decorated signature to arguments
  gdbus: add decorated signature to return values
  gdbus: add Deprecated annotation to introspection
  gdbus: add Method.NoReply annotation to introspection
  Constify GDBus method tables
  Constify GDBus signal tables

 attrib/client.c           |   14 ++--
 audio/control.c           |    6 +-
 audio/device.c            |    8 +-
 audio/gateway.c           |   12 +--
 audio/headset.c           |   22 +++---
 audio/media.c             |   10 +--
 audio/sink.c              |    8 +-
 audio/source.c            |    8 +-
 audio/telephony-dummy.c   |   18 ++---
 audio/telephony-maemo5.c  |    4 +-
 audio/transport.c         |   14 ++--
 doc/serial-api.txt        |    2 +-
 gdbus/gdbus.h             |    6 +-
 gdbus/object.c            |  178 ++++++++++++++++++++++++++++++++++++++++-----
 health/hdp.c              |   28 +++----
 input/device.c            |    8 +-
 network/connection.c      |   10 +--
 network/server.c          |    6 +-
 plugins/dbusoob.c         |    8 +-
 plugins/service.c         |   10 +--
 proximity/monitor.c       |   10 +--
 proximity/reporter.c      |    8 +-
 sap/sap-dummy.c           |    8 +-
 sap/server.c              |    8 +-
 serial/port.c             |    8 +-
 serial/proxy.c            |   20 ++---
 src/adapter.c             |   36 ++++-----
 src/device.c              |   12 +--
 src/manager.c             |   20 ++---
 thermometer/thermometer.c |   18 ++---
 30 files changed, 333 insertions(+), 195 deletions(-)

-- 
1.7.10


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [BlueZ v3 01/10] gdbus: return if method signature is malformed
  2012-04-27 21:14 [BlueZ v3 00/10] gdbus: Better D-Bus introspection Lucas De Marchi
@ 2012-04-27 21:14 ` Lucas De Marchi
  2012-04-27 21:14 ` [BlueZ v3 02/10] gdbus: do not call memset for terminating NUL Lucas De Marchi
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Lucas De Marchi @ 2012-04-27 21:14 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Lucas De Marchi

---
 gdbus/object.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gdbus/object.c b/gdbus/object.c
index 8bc12f5..7a94156 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -107,6 +107,10 @@ static void print_arguments(GString *gstr, const char *sig,
 				break;
 		}
 
+		if (!complete) {
+			error("Unexpected signature: %s", sig);
+			return;
+		}
 
 		if (direction)
 			g_string_append_printf(gstr,
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [BlueZ v3 02/10] gdbus: do not call memset for terminating NUL
  2012-04-27 21:14 [BlueZ v3 00/10] gdbus: Better D-Bus introspection Lucas De Marchi
  2012-04-27 21:14 ` [BlueZ v3 01/10] gdbus: return if method signature is malformed Lucas De Marchi
@ 2012-04-27 21:14 ` Lucas De Marchi
  2012-04-27 21:14 ` [BlueZ v3 03/10] gdbus: save copy of undecorated signature Lucas De Marchi
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Lucas De Marchi @ 2012-04-27 21:14 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Lucas De Marchi

---
 gdbus/object.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gdbus/object.c b/gdbus/object.c
index 7a94156..e378074 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -72,7 +72,6 @@ static void print_arguments(GString *gstr, const char *sig,
 
 		complete = FALSE;
 		struct_level = dict_level = 0;
-		memset(type, 0, sizeof(type));
 
 		/* Gather enough data to have a single complete type */
 		for (len = 0; len < (sizeof(type) - 1) && sig[i]; len++, i++) {
@@ -107,6 +106,8 @@ static void print_arguments(GString *gstr, const char *sig,
 				break;
 		}
 
+		type[len + 1] = '\0';
+
 		if (!complete) {
 			error("Unexpected signature: %s", sig);
 			return;
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [BlueZ v3 03/10] gdbus: save copy of undecorated signature
  2012-04-27 21:14 [BlueZ v3 00/10] gdbus: Better D-Bus introspection Lucas De Marchi
  2012-04-27 21:14 ` [BlueZ v3 01/10] gdbus: return if method signature is malformed Lucas De Marchi
  2012-04-27 21:14 ` [BlueZ v3 02/10] gdbus: do not call memset for terminating NUL Lucas De Marchi
@ 2012-04-27 21:14 ` Lucas De Marchi
  2012-04-27 21:14 ` [BlueZ v3 04/10] gdbus: use argument name in method introspection Lucas De Marchi
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Lucas De Marchi @ 2012-04-27 21:14 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Lucas De Marchi

---
 gdbus/object.c |   82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)

diff --git a/gdbus/object.c b/gdbus/object.c
index e378074..6133d8c 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -25,6 +25,7 @@
 #include <config.h>
 #endif
 
+#include <assert.h>
 #include <stdio.h>
 #include <string.h>
 
@@ -46,7 +47,10 @@ struct generic_data {
 struct interface_data {
 	char *name;
 	const GDBusMethodTable *methods;
+	char **method_signatures;
+	char **reply_signatures;
 	const GDBusSignalTable *signals;
+	char **signal_signatures;
 	const GDBusPropertyTable *properties;
 	void *user_data;
 	GDBusDestroyFunction destroy;
@@ -501,6 +505,79 @@ static GDBusMethodTable introspect_methods[] = {
 	{ }
 };
 
+static char *undecorate_signature(const char *src)
+{
+	GString *dst = g_string_new(NULL);
+	size_t len;
+
+	for (len = 0; *src; src++) {
+		switch (*src) {
+		case '[':
+			assert(len > 0);
+			g_string_append_len(dst, src - len, len);
+
+			while (*src && *src != ']')
+				src++;
+
+			/* end of string without matching ']' */
+			assert(*src == ']');
+			len = 0;
+			break;
+		case ']':
+			/* ']' without '[' */
+			assert(0);
+			break;
+		default:
+			len++;
+		}
+	}
+
+	g_string_append_len(dst, src, len);
+
+	return g_string_free(dst, FALSE);
+}
+
+static void undecorate_signals(struct interface_data *iface)
+{
+	const GDBusSignalTable *s;
+	size_t n, i;
+	char **sigs;
+
+	for (s = iface->signals, n = 0; s && s->name; s++)
+		n++;
+
+	sigs = g_new(char *, n + 1);
+	sigs[n] = NULL;
+
+	for (s = iface->signals, i = 0; s && s->name; s++, i++)
+		sigs[i] = undecorate_signature(s->signature);
+
+	iface->signal_signatures = sigs;
+}
+
+static void undecorate_methods(struct interface_data *iface)
+{
+	const GDBusMethodTable *m;
+	size_t n, i;
+	char **sigs, **reply_sigs;
+
+	for (m = iface->methods, n = 0; m && m->name; m++)
+		n++;
+
+	sigs = g_new(char *, n + 1);
+	reply_sigs = g_new(char *, n + 1);
+	sigs[n] = NULL;
+	reply_sigs[n] = NULL;
+
+	for (m = iface->methods, i = 0; m && m->name; m++, i++) {
+		sigs[i] = undecorate_signature(m->signature);
+		reply_sigs[i] = undecorate_signature(m->reply);
+	}
+
+	iface->method_signatures = sigs;
+	iface->reply_signatures = reply_sigs;
+}
+
 static void add_interface(struct generic_data *data, const char *name,
 				const GDBusMethodTable *methods,
 				const GDBusSignalTable *signals,
@@ -513,7 +590,9 @@ static void add_interface(struct generic_data *data, const char *name,
 	iface = g_new0(struct interface_data, 1);
 	iface->name = g_strdup(name);
 	iface->methods = methods;
+	undecorate_methods(iface);
 	iface->signals = signals;
+	undecorate_signals(iface);
 	iface->properties = properties;
 	iface->user_data = user_data;
 	iface->destroy = destroy;
@@ -568,6 +647,9 @@ static gboolean remove_interface(struct generic_data *data, const char *name)
 		iface->destroy(iface->user_data);
 
 	g_free(iface->name);
+	g_strfreev(iface->method_signatures);
+	g_strfreev(iface->reply_signatures);
+	g_strfreev(iface->signal_signatures);
 	g_free(iface);
 
 	return TRUE;
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [BlueZ v3 04/10] gdbus: use argument name in method introspection
  2012-04-27 21:14 [BlueZ v3 00/10] gdbus: Better D-Bus introspection Lucas De Marchi
                   ` (2 preceding siblings ...)
  2012-04-27 21:14 ` [BlueZ v3 03/10] gdbus: save copy of undecorated signature Lucas De Marchi
@ 2012-04-27 21:14 ` Lucas De Marchi
  2012-04-27 21:14 ` [BlueZ v3 05/10] gdbus: add decorated signature to arguments Lucas De Marchi
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Lucas De Marchi @ 2012-04-27 21:14 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Lucas De Marchi

---
 gdbus/gdbus.h  |    6 ++---
 gdbus/object.c |   70 ++++++++++++++++++++++++++++++++++++++++----------------
 2 files changed, 53 insertions(+), 23 deletions(-)

diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h
index a0583e6..a5843e0 100644
--- a/gdbus/gdbus.h
+++ b/gdbus/gdbus.h
@@ -84,8 +84,8 @@ typedef enum {
 
 typedef struct {
 	const char *name;
-	const char *signature;
-	const char *reply;
+	const char *decorated_signature;
+	const char *decorated_reply;
 	GDBusMethodFunction function;
 	GDBusMethodFlags flags;
 	unsigned int privilege;
@@ -93,7 +93,7 @@ typedef struct {
 
 typedef struct {
 	const char *name;
-	const char *signature;
+	const char *decorated_signature;
 	GDBusSignalFlags flags;
 } GDBusSignalTable;
 
diff --git a/gdbus/object.c b/gdbus/object.c
index 6133d8c..bae6e7f 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -69,6 +69,7 @@ static void print_arguments(GString *gstr, const char *sig,
 	int i;
 
 	for (i = 0; sig[i]; i++) {
+		const char *name;
 		char type[32];
 		int struct_level, dict_level;
 		unsigned int len;
@@ -112,19 +113,44 @@ static void print_arguments(GString *gstr, const char *sig,
 
 		type[len + 1] = '\0';
 
+		 /* Check if there is an arg name and parse it */
+		if (sig[i + 1] == '[') {
+			const char *name_end = name = &sig[i + 2];
+
+			for (;;) {
+				if (*name_end == '\0') {
+					error("Unexpected signature: %s", sig);
+					return;
+				}
+
+				if (*name_end == ']')
+					break;
+
+				name_end++;
+			}
+
+			len = name_end - name;
+			i += len + 2;
+		} else
+			name = NULL;
+
 		if (!complete) {
 			error("Unexpected signature: %s", sig);
 			return;
 		}
 
+		g_string_append_printf(gstr, "\t\t\t<arg type=\"%s\"", type);
+
 		if (direction)
-			g_string_append_printf(gstr,
-					"\t\t\t<arg type=\"%s\" direction=\"%s\"/>\n",
-					type, direction);
-		else
-			g_string_append_printf(gstr,
-					"\t\t\t<arg type=\"%s\"/>\n",
-					type);
+			g_string_append_printf(gstr, " direction=\"%s\"",
+								direction);
+
+		if (name)
+			g_string_append_printf(gstr, " name=\"%.*s\"",
+								len, name);
+
+
+		g_string_append_printf(gstr,"/>\n");
 	}
 }
 
@@ -134,26 +160,27 @@ static void generate_interface_xml(GString *gstr, struct interface_data *iface)
 	const GDBusSignalTable *signal;
 
 	for (method = iface->methods; method && method->name; method++) {
-		if (!strlen(method->signature) && !strlen(method->reply))
+		if (!strlen(method->decorated_signature) &&
+					!strlen(method->decorated_reply))
 			g_string_append_printf(gstr, "\t\t<method name=\"%s\"/>\n",
 								method->name);
 		else {
 			g_string_append_printf(gstr, "\t\t<method name=\"%s\">\n",
 								method->name);
-			print_arguments(gstr, method->signature, "in");
-			print_arguments(gstr, method->reply, "out");
+			print_arguments(gstr, method->decorated_signature, "in");
+			print_arguments(gstr, method->decorated_reply, "out");
 			g_string_append_printf(gstr, "\t\t</method>\n");
 		}
 	}
 
 	for (signal = iface->signals; signal && signal->name; signal++) {
-		if (!strlen(signal->signature))
+		if (!strlen(signal->decorated_signature))
 			g_string_append_printf(gstr, "\t\t<signal name=\"%s\"/>\n",
 								signal->name);
 		else {
 			g_string_append_printf(gstr, "\t\t<signal name=\"%s\">\n",
 								signal->name);
-			print_arguments(gstr, signal->signature, NULL);
+			print_arguments(gstr, signal->decorated_signature, NULL);
 			g_string_append_printf(gstr, "\t\t</signal>\n");
 		}
 	}
@@ -432,6 +459,7 @@ static DBusHandlerResult generic_message(DBusConnection *connection,
 	struct interface_data *iface;
 	const GDBusMethodTable *method;
 	const char *interface;
+	size_t i;
 
 	interface = dbus_message_get_interface(message);
 
@@ -439,14 +467,14 @@ static DBusHandlerResult generic_message(DBusConnection *connection,
 	if (iface == NULL)
 		return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 
-	for (method = iface->methods; method &&
-			method->name && method->function; method++) {
+	for (method = iface->methods, i = 0; method &&
+			method->name && method->function; method++, i++) {
 		if (dbus_message_is_method_call(message, iface->name,
 							method->name) == FALSE)
 			continue;
 
 		if (dbus_message_has_signature(message,
-						method->signature) == FALSE)
+					iface->method_signatures[i]) == FALSE)
 			continue;
 
 		if (check_privilege(connection, message, method,
@@ -550,7 +578,7 @@ static void undecorate_signals(struct interface_data *iface)
 	sigs[n] = NULL;
 
 	for (s = iface->signals, i = 0; s && s->name; s++, i++)
-		sigs[i] = undecorate_signature(s->signature);
+		sigs[i] = undecorate_signature(s->decorated_signature);
 
 	iface->signal_signatures = sigs;
 }
@@ -570,8 +598,8 @@ static void undecorate_methods(struct interface_data *iface)
 	reply_sigs[n] = NULL;
 
 	for (m = iface->methods, i = 0; m && m->name; m++, i++) {
-		sigs[i] = undecorate_signature(m->signature);
-		reply_sigs[i] = undecorate_signature(m->reply);
+		sigs[i] = undecorate_signature(m->decorated_signature);
+		reply_sigs[i] = undecorate_signature(m->decorated_reply);
 	}
 
 	iface->method_signatures = sigs;
@@ -685,6 +713,7 @@ static gboolean check_signal(DBusConnection *conn, const char *path,
 	struct generic_data *data = NULL;
 	struct interface_data *iface;
 	const GDBusSignalTable *signal;
+	size_t i;
 
 	*args = NULL;
 	if (!dbus_connection_get_object_path_data(conn, path,
@@ -701,9 +730,10 @@ static gboolean check_signal(DBusConnection *conn, const char *path,
 		return FALSE;
 	}
 
-	for (signal = iface->signals; signal && signal->name; signal++) {
+	for (signal = iface->signals, i = 0; signal && signal->name;
+							signal++, i++) {
 		if (!strcmp(signal->name, name)) {
-			*args = signal->signature;
+			*args = iface->signal_signatures[i];
 			break;
 		}
 	}
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [BlueZ v3 05/10] gdbus: add decorated signature to arguments
  2012-04-27 21:14 [BlueZ v3 00/10] gdbus: Better D-Bus introspection Lucas De Marchi
                   ` (3 preceding siblings ...)
  2012-04-27 21:14 ` [BlueZ v3 04/10] gdbus: use argument name in method introspection Lucas De Marchi
@ 2012-04-27 21:14 ` Lucas De Marchi
  2012-04-27 21:14 ` [BlueZ v3 06/10] gdbus: add decorated signature to return values Lucas De Marchi
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Lucas De Marchi @ 2012-04-27 21:14 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Lucas De Marchi

---
 attrib/client.c           |    6 +++---
 audio/control.c           |    2 +-
 audio/device.c            |    2 +-
 audio/gateway.c           |    6 +++---
 audio/headset.c           |   12 ++++++------
 audio/media.c             |    8 ++++----
 audio/sink.c              |    2 +-
 audio/source.c            |    2 +-
 audio/telephony-dummy.c   |   14 +++++++-------
 audio/telephony-maemo5.c  |    2 +-
 audio/transport.c         |    8 ++++----
 doc/serial-api.txt        |    2 +-
 health/hdp.c              |   14 +++++++-------
 input/device.c            |    2 +-
 network/connection.c      |    4 ++--
 network/server.c          |    4 ++--
 plugins/dbusoob.c         |    4 ++--
 plugins/service.c         |    8 ++++----
 proximity/monitor.c       |    4 ++--
 proximity/reporter.c      |    2 +-
 sap/sap-dummy.c           |    6 +++---
 sap/server.c              |    2 +-
 serial/port.c             |    6 +++---
 serial/proxy.c            |   12 ++++++------
 src/adapter.c             |   28 ++++++++++++++--------------
 src/device.c              |    6 +++---
 src/manager.c             |   10 +++++-----
 thermometer/thermometer.c |   14 +++++++-------
 28 files changed, 96 insertions(+), 96 deletions(-)

diff --git a/attrib/client.c b/attrib/client.c
index 35f1c90..0a5904d 100644
--- a/attrib/client.c
+++ b/attrib/client.c
@@ -517,7 +517,7 @@ static DBusMessage *set_property(DBusConnection *conn,
 
 static GDBusMethodTable char_methods[] = {
 	{ "GetProperties",	"",	"a{sv}", get_properties },
-	{ "SetProperty",	"sv",	"",	set_property,
+	{ "SetProperty", "s[name]v[value]", "", set_property,
 						G_DBUS_METHOD_FLAG_ASYNC},
 	{ }
 };
@@ -1018,9 +1018,9 @@ static DBusMessage *prim_get_properties(DBusConnection *conn, DBusMessage *msg,
 static GDBusMethodTable prim_methods[] = {
 	{ "DiscoverCharacteristics",	"",	"ao",	discover_char,
 					G_DBUS_METHOD_FLAG_ASYNC	},
-	{ "RegisterCharacteristicsWatcher",	"o", "",
+	{ "RegisterCharacteristicsWatcher",	"o[agent]", "",
 						register_watcher	},
-	{ "UnregisterCharacteristicsWatcher",	"o", "",
+	{ "UnregisterCharacteristicsWatcher",	"o[agent]", "",
 						unregister_watcher	},
 	{ "GetProperties",	"",	"a{sv}",prim_get_properties	},
 	{ }
diff --git a/audio/control.c b/audio/control.c
index a75e992..23bca56 100644
--- a/audio/control.c
+++ b/audio/control.c
@@ -209,7 +209,7 @@ static GDBusMethodTable control_methods[] = {
 static GDBusSignalTable control_signals[] = {
 	{ "Connected",			"",	G_DBUS_SIGNAL_FLAG_DEPRECATED},
 	{ "Disconnected",		"",	G_DBUS_SIGNAL_FLAG_DEPRECATED},
-	{ "PropertyChanged",		"sv"	},
+	{ "PropertyChanged",		"s[name]v[value]"	},
 	{ NULL, NULL }
 };
 
diff --git a/audio/device.c b/audio/device.c
index a9d35f9..3875319 100644
--- a/audio/device.c
+++ b/audio/device.c
@@ -627,7 +627,7 @@ static GDBusMethodTable dev_methods[] = {
 };
 
 static GDBusSignalTable dev_signals[] = {
-	{ "PropertyChanged",		"sv"	},
+	{ "PropertyChanged",		"s[name]v[value]"	},
 	{ NULL, NULL }
 };
 
diff --git a/audio/gateway.c b/audio/gateway.c
index 7b9347d..1e8943a 100644
--- a/audio/gateway.c
+++ b/audio/gateway.c
@@ -716,13 +716,13 @@ static GDBusMethodTable gateway_methods[] = {
 	{ "Connect", "", "", ag_connect, G_DBUS_METHOD_FLAG_ASYNC },
 	{ "Disconnect", "", "", ag_disconnect, G_DBUS_METHOD_FLAG_ASYNC },
 	{ "GetProperties", "", "a{sv}", ag_get_properties },
-	{ "RegisterAgent", "o", "", register_agent },
-	{ "UnregisterAgent", "o", "", unregister_agent },
+	{ "RegisterAgent", "o[agent]", "", register_agent },
+	{ "UnregisterAgent", "o[agent]", "", unregister_agent },
 	{ NULL, NULL, NULL, NULL }
 };
 
 static GDBusSignalTable gateway_signals[] = {
-	{ "PropertyChanged", "sv" },
+	{ "PropertyChanged", "s[name]v[value]" },
 	{ NULL, NULL }
 };
 
diff --git a/audio/headset.c b/audio/headset.c
index f15951d..61e09cb 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -2072,12 +2072,12 @@ static GDBusMethodTable headset_methods[] = {
 						G_DBUS_METHOD_FLAG_DEPRECATED },
 	{ "GetMicrophoneGain",	"",	"q",	hs_get_mic_gain,
 						G_DBUS_METHOD_FLAG_DEPRECATED },
-	{ "SetSpeakerGain",	"q",	"",	hs_set_speaker_gain,
+	{ "SetSpeakerGain",	"q[gain]", "",	hs_set_speaker_gain,
 						G_DBUS_METHOD_FLAG_DEPRECATED },
-	{ "SetMicrophoneGain",	"q",	"",	hs_set_mic_gain,
+	{ "SetMicrophoneGain",	"q[gain]", "",	hs_set_mic_gain,
 						G_DBUS_METHOD_FLAG_DEPRECATED },
 	{ "GetProperties",	"",	"a{sv}",hs_get_properties },
-	{ "SetProperty",	"sv",	"",	hs_set_property },
+	{ "SetProperty",	"s[name]v[value]", "", hs_set_property },
 	{ NULL, NULL, NULL, NULL }
 };
 
@@ -2087,10 +2087,10 @@ static GDBusSignalTable headset_signals[] = {
 	{ "AnswerRequested",		""	},
 	{ "Stopped",			"",	G_DBUS_SIGNAL_FLAG_DEPRECATED },
 	{ "Playing",			"",	G_DBUS_SIGNAL_FLAG_DEPRECATED },
-	{ "SpeakerGainChanged",		"q",	G_DBUS_SIGNAL_FLAG_DEPRECATED },
-	{ "MicrophoneGainChanged",	"q",	G_DBUS_SIGNAL_FLAG_DEPRECATED },
+	{ "SpeakerGainChanged",		"q[gain]", G_DBUS_SIGNAL_FLAG_DEPRECATED },
+	{ "MicrophoneGainChanged",	"q[gain]", G_DBUS_SIGNAL_FLAG_DEPRECATED },
 	{ "CallTerminated",		""	},
-	{ "PropertyChanged",		"sv"	},
+	{ "PropertyChanged",		"s[name]v[value]" },
 	{ NULL, NULL }
 };
 
diff --git a/audio/media.c b/audio/media.c
index c0fd0c3..6607230 100644
--- a/audio/media.c
+++ b/audio/media.c
@@ -1706,10 +1706,10 @@ static DBusMessage *unregister_player(DBusConnection *conn, DBusMessage *msg,
 }
 
 static GDBusMethodTable media_methods[] = {
-	{ "RegisterEndpoint",	"oa{sv}",	"",	register_endpoint },
-	{ "UnregisterEndpoint",	"o",		"",	unregister_endpoint },
-	{ "RegisterPlayer",	"oa{sv}a{sv}","",	register_player },
-	{ "UnregisterPlayer",	"o",		"",	unregister_player },
+	{ "RegisterEndpoint", "o[endpoint]a{sv}[properties]", "", register_endpoint },
+	{ "UnregisterEndpoint", "o[endpoint]", "", unregister_endpoint },
+	{ "RegisterPlayer", "o[player]a{sv}[properties]a{sv}[metadata]", "", register_player },
+	{ "UnregisterPlayer", "o[player]", "", unregister_player },
 	{ },
 };
 
diff --git a/audio/sink.c b/audio/sink.c
index 52f70a9..790aad4 100644
--- a/audio/sink.c
+++ b/audio/sink.c
@@ -571,7 +571,7 @@ static GDBusSignalTable sink_signals[] = {
 	{ "Disconnected",		"",	G_DBUS_SIGNAL_FLAG_DEPRECATED },
 	{ "Playing",			"",	G_DBUS_SIGNAL_FLAG_DEPRECATED },
 	{ "Stopped",			"",	G_DBUS_SIGNAL_FLAG_DEPRECATED },
-	{ "PropertyChanged",		"sv"	},
+	{ "PropertyChanged",		"s[name]v[value]"	},
 	{ NULL, NULL }
 };
 
diff --git a/audio/source.c b/audio/source.c
index 4c6e2d0..b9c7b77 100644
--- a/audio/source.c
+++ b/audio/source.c
@@ -486,7 +486,7 @@ static GDBusMethodTable source_methods[] = {
 };
 
 static GDBusSignalTable source_signals[] = {
-	{ "PropertyChanged",		"sv"	},
+	{ "PropertyChanged",		"s[name]v[value]"	},
 	{ NULL, NULL }
 };
 
diff --git a/audio/telephony-dummy.c b/audio/telephony-dummy.c
index 1f89079..ec94d17 100644
--- a/audio/telephony-dummy.c
+++ b/audio/telephony-dummy.c
@@ -379,14 +379,14 @@ static DBusMessage *set_subscriber_number(DBusConnection *conn,
 }
 
 static GDBusMethodTable dummy_methods[] = {
-	{ "OutgoingCall",	"s",	"",	outgoing_call		},
-	{ "IncomingCall",	"s",	"",	incoming_call		},
+	{ "OutgoingCall",	"s[number]", "", outgoing_call		},
+	{ "IncomingCall",	"s[number]", "", incoming_call		},
 	{ "CancelCall",		"",	"",	cancel_call		},
-	{ "SignalStrength",	"u",	"",	signal_strength		},
-	{ "BatteryLevel",	"u",	"",	battery_level		},
-	{ "RoamingStatus",	"b",	"",	roaming_status		},
-	{ "RegistrationStatus",	"b",	"",	registration_status	},
-	{ "SetSubscriberNumber","s",	"",	set_subscriber_number	},
+	{ "SignalStrength",	"u[strength]","", signal_strength	},
+	{ "BatteryLevel",	"u[level]", "", battery_level		},
+	{ "RoamingStatus",	"b[roaming]", "", roaming_status	},
+	{ "RegistrationStatus",	"b[registration]", "", registration_status },
+	{ "SetSubscriberNumber","s[number]", "", set_subscriber_number	},
 	{ }
 };
 
diff --git a/audio/telephony-maemo5.c b/audio/telephony-maemo5.c
index 49230f1..4ee0f24 100644
--- a/audio/telephony-maemo5.c
+++ b/audio/telephony-maemo5.c
@@ -1952,7 +1952,7 @@ static DBusMessage *set_callerid(DBusConnection *conn, DBusMessage *msg,
 }
 
 static GDBusMethodTable telephony_maemo_methods[] = {
-	{"SetCallerId",		"s",	"",	set_callerid,
+	{"SetCallerId",		"s[id]", "",	set_callerid,
 						G_DBUS_METHOD_FLAG_ASYNC},
 	{ }
 };
diff --git a/audio/transport.c b/audio/transport.c
index 7bf7309..ae2c3f9 100644
--- a/audio/transport.c
+++ b/audio/transport.c
@@ -916,16 +916,16 @@ static DBusMessage *get_properties(DBusConnection *conn, DBusMessage *msg,
 
 static GDBusMethodTable transport_methods[] = {
 	{ "GetProperties",	"",	"a{sv}",	get_properties },
-	{ "Acquire",		"s",	"hqq",		acquire,
+	{ "Acquire",		"s[accesstype]", "hqq", acquire,
 						G_DBUS_METHOD_FLAG_ASYNC},
-	{ "Release",		"s",	"",		release,
+	{ "Release",		"s[accesstype]", "", release,
 						G_DBUS_METHOD_FLAG_ASYNC},
-	{ "SetProperty",	"sv",	"",		set_property },
+	{ "SetProperty",	"s[name]v[value]", "", set_property },
 	{ },
 };
 
 static GDBusSignalTable transport_signals[] = {
-	{ "PropertyChanged",	"sv"	},
+	{ "PropertyChanged",	"s[name]v[value]" },
 	{ }
 };
 
diff --git a/doc/serial-api.txt b/doc/serial-api.txt
index 0bdbdcd..e6319cf 100644
--- a/doc/serial-api.txt
+++ b/doc/serial-api.txt
@@ -26,7 +26,7 @@ Methods		string Connect(string pattern)
 					 org.bluez.Error.ConnectionAttemptFailed
 					 org.bluez.Error.NotSupported
 
-Methods		fd ConnectFD(string pattern) [experimental]
+		fd ConnectFD(string pattern) [experimental]
 
 			Connects to a specific RFCOMM based service on a
 			remote device and returns a file descriptor to talk
diff --git a/health/hdp.c b/health/hdp.c
index 455240c..2723910 100644
--- a/health/hdp.c
+++ b/health/hdp.c
@@ -425,8 +425,8 @@ static void manager_path_unregister(gpointer data)
 }
 
 static GDBusMethodTable health_manager_methods[] = {
-	{"CreateApplication", "a{sv}", "o", manager_create_application},
-	{"DestroyApplication", "o", "", manager_destroy_application},
+	{"CreateApplication", "a{sv}[config]", "o", manager_create_application},
+	{"DestroyApplication", "o[application]", "", manager_destroy_application},
 	{ NULL }
 };
 
@@ -2096,18 +2096,18 @@ static void health_device_destroy(void *data)
 static GDBusMethodTable health_device_methods[] = {
 	{"Echo",		"",	"b",	device_echo,
 						G_DBUS_METHOD_FLAG_ASYNC },
-	{"CreateChannel",	"os",	"o",	device_create_channel,
+	{"CreateChannel", "o[application]s[configuration]", "o", device_create_channel,
 						G_DBUS_METHOD_FLAG_ASYNC },
-	{"DestroyChannel",	"o",	"",	device_destroy_channel,
+	{"DestroyChannel", "o[channel]", "", device_destroy_channel,
 						G_DBUS_METHOD_FLAG_ASYNC },
 	{"GetProperties",	"",	"a{sv}", device_get_properties},
 	{ NULL }
 };
 
 static GDBusSignalTable health_device_signals[] = {
-	{"ChannelConnected",		"o"		},
-	{"ChannelDeleted",		"o"		},
-	{"PropertyChanged",		"sv"		},
+	{"ChannelConnected",		"o[channel]"		},
+	{"ChannelDeleted",		"o[channel]"		},
+	{"PropertyChanged",		"s[name]v[value]"	},
 	{ NULL }
 };
 
diff --git a/input/device.c b/input/device.c
index 59388d8..a30e0e5 100644
--- a/input/device.c
+++ b/input/device.c
@@ -1028,7 +1028,7 @@ static GDBusMethodTable device_methods[] = {
 };
 
 static GDBusSignalTable device_signals[] = {
-	{ "PropertyChanged",	"sv"	},
+	{ "PropertyChanged",	"s[name]v[value]"	},
 	{ }
 };
 
diff --git a/network/connection.c b/network/connection.c
index 36b51a7..b4c3288 100644
--- a/network/connection.c
+++ b/network/connection.c
@@ -553,7 +553,7 @@ static void path_unregister(void *data)
 }
 
 static GDBusMethodTable connection_methods[] = {
-	{ "Connect",		"s",	"s",	connection_connect,
+	{ "Connect",		"s[uuid]",	"s",	connection_connect,
 						G_DBUS_METHOD_FLAG_ASYNC },
 	{ "Disconnect",		"",	"",	connection_disconnect	},
 	{ "GetProperties",	"",	"a{sv}",connection_get_properties },
@@ -561,7 +561,7 @@ static GDBusMethodTable connection_methods[] = {
 };
 
 static GDBusSignalTable connection_signals[] = {
-	{ "PropertyChanged",	"sv"	},
+	{ "PropertyChanged",	"s[name]v[value]"	},
 	{ }
 };
 
diff --git a/network/server.c b/network/server.c
index 58c7297..6cf9e18 100644
--- a/network/server.c
+++ b/network/server.c
@@ -686,8 +686,8 @@ static void path_unregister(void *data)
 }
 
 static GDBusMethodTable server_methods[] = {
-	{ "Register",	"ss",	"",	register_server		},
-	{ "Unregister",	"s",	"",	unregister_server	},
+	{ "Register",	"s[uuid]s[bridge]", "", register_server },
+	{ "Unregister",	"s[uuid]", "", unregister_server },
 	{ }
 };
 
diff --git a/plugins/dbusoob.c b/plugins/dbusoob.c
index 2c03780..1612fab 100644
--- a/plugins/dbusoob.c
+++ b/plugins/dbusoob.c
@@ -176,8 +176,8 @@ static DBusMessage *remove_remote_data(DBusConnection *conn, DBusMessage *msg,
 }
 
 static GDBusMethodTable oob_methods[] = {
-	{"AddRemoteData",	"sayay",	"",	add_remote_data},
-	{"RemoveRemoteData",	"s",		"",	remove_remote_data},
+	{"AddRemoteData", "s[address]ay[hash]ay[randomizer]", "", add_remote_data},
+	{"RemoveRemoteData", "s[address]", "", remove_remote_data},
 	{"ReadLocalData",	"",		"ayay",	read_local_data,
 						G_DBUS_METHOD_FLAG_ASYNC},
 	{}
diff --git a/plugins/service.c b/plugins/service.c
index 14a5cb6..19fe666 100644
--- a/plugins/service.c
+++ b/plugins/service.c
@@ -697,10 +697,10 @@ done:
 }
 
 static GDBusMethodTable service_methods[] = {
-	{ "AddRecord",		"s",	"u",	add_service_record	},
-	{ "UpdateRecord",	"us",	"",	update_service_record	},
-	{ "RemoveRecord",	"u",	"",	remove_service_record	},
-	{ "RequestAuthorization","su",	"",	request_authorization,
+	{ "AddRecord", "s[record]", "u", add_service_record },
+	{ "UpdateRecord", "u[handle]s[record]", "", update_service_record	},
+	{ "RemoveRecord", "u[handle]", "", remove_service_record },
+	{ "RequestAuthorization","s[address]u[handle]",	"", request_authorization,
 						G_DBUS_METHOD_FLAG_ASYNC},
 	{ "CancelAuthorization", "",	"",	cancel_authorization	},
 	{ }
diff --git a/proximity/monitor.c b/proximity/monitor.c
index 687b41c..903ab69 100644
--- a/proximity/monitor.c
+++ b/proximity/monitor.c
@@ -548,13 +548,13 @@ static DBusMessage *set_property(DBusConnection *conn,
 
 static GDBusMethodTable monitor_methods[] = {
 	{ "GetProperties",	"",	"a{sv}",	get_properties	},
-	{ "SetProperty",	"sv",	"",		set_property,
+	{ "SetProperty",	"s[name]v[value]", "", set_property,
 						G_DBUS_METHOD_FLAG_ASYNC},
 	{ }
 };
 
 static GDBusSignalTable monitor_signals[] = {
-	{ "PropertyChanged",	"sv"	},
+	{ "PropertyChanged",	"s[name]v[value]"	},
 	{ }
 };
 
diff --git a/proximity/reporter.c b/proximity/reporter.c
index cb30da5..ac32ef7 100644
--- a/proximity/reporter.c
+++ b/proximity/reporter.c
@@ -186,7 +186,7 @@ static GDBusMethodTable reporter_methods[] = {
 };
 
 static GDBusSignalTable reporter_signals[] = {
-	{ "PropertyChanged",	"sv"	},
+	{ "PropertyChanged",	"s[name]v[value]"	},
 	{ }
 };
 
diff --git a/sap/sap-dummy.c b/sap/sap-dummy.c
index acdec77..6c4af62 100644
--- a/sap/sap-dummy.c
+++ b/sap/sap-dummy.c
@@ -316,10 +316,10 @@ static DBusMessage *card_status(DBusConnection *conn, DBusMessage *msg,
 }
 
 static GDBusMethodTable dummy_methods[] = {
-	{ "OngoingCall", "b", "", ongoing_call},
-	{ "MaxMessageSize", "u", "", max_msg_size},
+	{ "OngoingCall", "b[ongoing]", "", ongoing_call},
+	{ "MaxMessageSize", "u[size]", "", max_msg_size},
 	{ "DisconnectImmediate", "", "", disconnect_immediate},
-	{ "CardStatus", "u", "", card_status},
+	{ "CardStatus", "u[status]", "", card_status},
 	{ }
 };
 
diff --git a/sap/server.c b/sap/server.c
index eaf9d86..e0fcd9b 100644
--- a/sap/server.c
+++ b/sap/server.c
@@ -1310,7 +1310,7 @@ static GDBusMethodTable server_methods[] = {
 };
 
 static GDBusSignalTable server_signals[] = {
-	{ "PropertyChanged", "sv"},
+	{ "PropertyChanged", "s[name]v[value]"},
 	{ }
 };
 
diff --git a/serial/port.c b/serial/port.c
index ea45c7a..e7ec22b 100644
--- a/serial/port.c
+++ b/serial/port.c
@@ -568,9 +568,9 @@ static DBusMessage *port_disconnect(DBusConnection *conn,
 }
 
 static GDBusMethodTable port_methods[] = {
-	{ "Connect",    "s", "s", port_connect, G_DBUS_METHOD_FLAG_ASYNC },
-	{ "ConnectFD",    "s", "h", port_connect, G_DBUS_METHOD_FLAG_ASYNC },
-	{ "Disconnect", "s", "",  port_disconnect },
+	{ "Connect", "s[pattern]", "s", port_connect, G_DBUS_METHOD_FLAG_ASYNC },
+	{ "ConnectFD", "s[pattern]", "h", port_connect, G_DBUS_METHOD_FLAG_ASYNC },
+	{ "Disconnect", "s[device]", "",  port_disconnect },
 	{ }
 };
 
diff --git a/serial/proxy.c b/serial/proxy.c
index ea5c29f..b5631c7 100644
--- a/serial/proxy.c
+++ b/serial/proxy.c
@@ -732,7 +732,7 @@ static GDBusMethodTable proxy_methods[] = {
 	{ "Enable",			"",	"",	proxy_enable },
 	{ "Disable",			"",	"",	proxy_disable },
 	{ "GetInfo",			"",	"a{sv}",proxy_get_info },
-	{ "SetSerialParameters",	"syys",	"",	proxy_set_serial_params },
+	{ "SetSerialParameters", "s[rate]y[data]y[stop]s[parity]", "", proxy_set_serial_params },
 	{ },
 };
 
@@ -1112,15 +1112,15 @@ static void manager_path_unregister(void *data)
 }
 
 static GDBusMethodTable manager_methods[] = {
-	{ "CreateProxy",		"ss",	"s",	create_proxy },
-	{ "ListProxies",		"",	"as",	list_proxies },
-	{ "RemoveProxy",		"s",	"",	remove_proxy },
+	{ "CreateProxy", "s[pattern]s[address]", "s", create_proxy },
+	{ "ListProxies", "", "as", list_proxies },
+	{ "RemoveProxy", "s[path]", "", remove_proxy },
 	{ },
 };
 
 static GDBusSignalTable manager_signals[] = {
-	{ "ProxyCreated",		"s"	},
-	{ "ProxyRemoved",		"s"	},
+	{ "ProxyCreated", "s[path]" },
+	{ "ProxyRemoved", "s[path]" },
 	{ }
 };
 
diff --git a/src/adapter.c b/src/adapter.c
index 93b55e8..d89ab16 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -1661,7 +1661,7 @@ static DBusMessage *unregister_agent(DBusConnection *conn, DBusMessage *msg,
 
 static GDBusMethodTable adapter_methods[] = {
 	{ "GetProperties",	"",	"a{sv}",get_properties		},
-	{ "SetProperty",	"sv",	"",	set_property,
+	{ "SetProperty", "s[name]v[value]",	"",	set_property,
 						G_DBUS_METHOD_FLAG_ASYNC},
 	{ "RequestSession",	"",	"",	request_session,
 						G_DBUS_METHOD_FLAG_ASYNC},
@@ -1671,26 +1671,26 @@ static GDBusMethodTable adapter_methods[] = {
 						G_DBUS_METHOD_FLAG_ASYNC},
 	{ "ListDevices",	"",	"ao",	list_devices,
 						G_DBUS_METHOD_FLAG_DEPRECATED},
-	{ "CreateDevice",	"s",	"o",	create_device,
+	{ "CreateDevice", "s[address]", "o",	create_device,
 						G_DBUS_METHOD_FLAG_ASYNC},
-	{ "CreatePairedDevice",	"sos",	"o",	create_paired_device,
+	{ "CreatePairedDevice", "s[address]o[agent]s[capability]", "o",
+			create_paired_device, G_DBUS_METHOD_FLAG_ASYNC},
+	{ "CancelDeviceCreation","s[address]", "", cancel_device_creation,
 						G_DBUS_METHOD_FLAG_ASYNC},
-	{ "CancelDeviceCreation","s",	"",	cancel_device_creation,
+	{ "RemoveDevice", "o[device]", "", remove_device,
 						G_DBUS_METHOD_FLAG_ASYNC},
-	{ "RemoveDevice",	"o",	"",	remove_device,
-						G_DBUS_METHOD_FLAG_ASYNC},
-	{ "FindDevice",		"s",	"o",	find_device		},
-	{ "RegisterAgent",	"os",	"",	register_agent		},
-	{ "UnregisterAgent",	"o",	"",	unregister_agent	},
+	{ "FindDevice",	"s[address]", "o", find_device },
+	{ "RegisterAgent", "o[agent]s[capability]", "", register_agent },
+	{ "UnregisterAgent", "o[agent]", "", unregister_agent },
 	{ }
 };
 
 static GDBusSignalTable adapter_signals[] = {
-	{ "PropertyChanged",		"sv"		},
-	{ "DeviceCreated",		"o"		},
-	{ "DeviceRemoved",		"o"		},
-	{ "DeviceFound",		"sa{sv}"	},
-	{ "DeviceDisappeared",		"s"		},
+	{ "PropertyChanged",		"s[name]v[value]"		},
+	{ "DeviceCreated",		"o[device]"			},
+	{ "DeviceRemoved",		"o[device]"			},
+	{ "DeviceFound",		"s[address]a{sv}[values]"	},
+	{ "DeviceDisappeared",		"s[address]"			},
 	{ }
 };
 
diff --git a/src/device.c b/src/device.c
index 021b200..3f5d826 100644
--- a/src/device.c
+++ b/src/device.c
@@ -879,8 +879,8 @@ static DBusMessage *disconnect(DBusConnection *conn, DBusMessage *msg,
 
 static GDBusMethodTable device_methods[] = {
 	{ "GetProperties",	"",	"a{sv}",	get_properties	},
-	{ "SetProperty",	"sv",	"",		set_property	},
-	{ "DiscoverServices",	"s",	"a{us}",	discover_services,
+	{ "SetProperty", "s[name]v[value]", "",		set_property	},
+	{ "DiscoverServices", "s[pattern]", "a{us}", discover_services,
 						G_DBUS_METHOD_FLAG_ASYNC},
 	{ "CancelDiscovery",	"",	"",		cancel_discover	},
 	{ "Disconnect",		"",	"",		disconnect,
@@ -889,7 +889,7 @@ static GDBusMethodTable device_methods[] = {
 };
 
 static GDBusSignalTable device_signals[] = {
-	{ "PropertyChanged",		"sv"	},
+	{ "PropertyChanged",		"s[name]v[value]" },
 	{ "DisconnectRequested",	""	},
 	{ }
 };
diff --git a/src/manager.c b/src/manager.c
index 6244516..258f966 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -199,17 +199,17 @@ static DBusMessage *get_properties(DBusConnection *conn,
 static GDBusMethodTable manager_methods[] = {
 	{ "GetProperties",	"",	"a{sv}",get_properties	},
 	{ "DefaultAdapter",	"",	"o",	default_adapter	},
-	{ "FindAdapter",	"s",	"o",	find_adapter	},
+	{ "FindAdapter", "s[pattern]", "o", find_adapter },
 	{ "ListAdapters",	"",	"ao",	list_adapters,
 						G_DBUS_METHOD_FLAG_DEPRECATED},
 	{ }
 };
 
 static GDBusSignalTable manager_signals[] = {
-	{ "PropertyChanged",		"sv"	},
-	{ "AdapterAdded",		"o"	},
-	{ "AdapterRemoved",		"o"	},
-	{ "DefaultAdapterChanged",	"o"	},
+	{ "PropertyChanged",		"s[name]v[value]"	},
+	{ "AdapterAdded",		"o[adapter]"		},
+	{ "AdapterRemoved",		"o[adapter]"		},
+	{ "DefaultAdapterChanged",	"o[adapter]"		},
 	{ }
 };
 
diff --git a/thermometer/thermometer.c b/thermometer/thermometer.c
index 92c0225..6fbb528 100644
--- a/thermometer/thermometer.c
+++ b/thermometer/thermometer.c
@@ -960,18 +960,18 @@ static DBusMessage *disable_intermediate(DBusConnection *conn, DBusMessage *msg,
 }
 
 static GDBusMethodTable thermometer_methods[] = {
-	{ "GetProperties",	"",	"a{sv}",	get_properties },
-	{ "SetProperty",	"sv",	"",		set_property,
+	{ "GetProperties", "", "a{sv}", get_properties },
+	{ "SetProperty", "s[name]v[value]", "", set_property,
 						G_DBUS_METHOD_FLAG_ASYNC },
-	{ "RegisterWatcher",	"o",	"",		register_watcher },
-	{ "UnregisterWatcher",	"o",	"",		unregister_watcher },
-	{ "EnableIntermediateMeasurement", "o", "", enable_intermediate },
-	{ "DisableIntermediateMeasurement","o",	"", disable_intermediate },
+	{ "RegisterWatcher", "o[agent]", "", register_watcher },
+	{ "UnregisterWatcher", "o[agent]", "", unregister_watcher },
+	{ "EnableIntermediateMeasurement", "o[agent]", "", enable_intermediate },
+	{ "DisableIntermediateMeasurement","o[agent]", "", disable_intermediate },
 	{ }
 };
 
 static GDBusSignalTable thermometer_signals[] = {
-	{ "PropertyChanged",	"sv"	},
+	{ "PropertyChanged",	"s[name]v[value]" },
 	{ }
 };
 
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [BlueZ v3 06/10] gdbus: add decorated signature to return values
  2012-04-27 21:14 [BlueZ v3 00/10] gdbus: Better D-Bus introspection Lucas De Marchi
                   ` (4 preceding siblings ...)
  2012-04-27 21:14 ` [BlueZ v3 05/10] gdbus: add decorated signature to arguments Lucas De Marchi
@ 2012-04-27 21:14 ` Lucas De Marchi
  2012-04-27 21:14 ` [BlueZ v3 07/10] gdbus: add Deprecated annotation to introspection Lucas De Marchi
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Lucas De Marchi @ 2012-04-27 21:14 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Lucas De Marchi

---
 attrib/client.c           |    4 ++--
 audio/device.c            |    2 +-
 audio/gateway.c           |    2 +-
 audio/headset.c           |    6 +++---
 audio/sink.c              |    2 +-
 audio/source.c            |    2 +-
 audio/transport.c         |    4 ++--
 gdbus/object.c            |    2 +-
 health/hdp.c              |   10 +++++-----
 input/device.c            |    2 +-
 network/connection.c      |    4 ++--
 plugins/dbusoob.c         |    2 +-
 proximity/monitor.c       |    2 +-
 proximity/reporter.c      |    2 +-
 sap/server.c              |    2 +-
 serial/port.c             |    4 ++--
 serial/proxy.c            |    6 +++---
 src/adapter.c             |   10 +++++-----
 src/device.c              |    4 ++--
 src/manager.c             |    8 ++++----
 thermometer/thermometer.c |    2 +-
 21 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/attrib/client.c b/attrib/client.c
index 0a5904d..7d3c3a5 100644
--- a/attrib/client.c
+++ b/attrib/client.c
@@ -516,7 +516,7 @@ static DBusMessage *set_property(DBusConnection *conn,
 }
 
 static GDBusMethodTable char_methods[] = {
-	{ "GetProperties",	"",	"a{sv}", get_properties },
+	{ "GetProperties",	"",	"a{sv}[properties]", get_properties },
 	{ "SetProperty", "s[name]v[value]", "", set_property,
 						G_DBUS_METHOD_FLAG_ASYNC},
 	{ }
@@ -1022,7 +1022,7 @@ static GDBusMethodTable prim_methods[] = {
 						register_watcher	},
 	{ "UnregisterCharacteristicsWatcher",	"o[agent]", "",
 						unregister_watcher	},
-	{ "GetProperties",	"",	"a{sv}",prim_get_properties	},
+	{ "GetProperties",	"",	"a{sv}[properties]",prim_get_properties	},
 	{ }
 };
 
diff --git a/audio/device.c b/audio/device.c
index 3875319..09cc0b1 100644
--- a/audio/device.c
+++ b/audio/device.c
@@ -622,7 +622,7 @@ static GDBusMethodTable dev_methods[] = {
 	{ "Connect",		"",	"",	dev_connect,
 						G_DBUS_METHOD_FLAG_ASYNC },
 	{ "Disconnect",		"",	"",	dev_disconnect },
-	{ "GetProperties",	"",	"a{sv}",dev_get_properties },
+	{ "GetProperties",	"",	"a{sv}[properties]",dev_get_properties },
 	{ NULL, NULL, NULL, NULL }
 };
 
diff --git a/audio/gateway.c b/audio/gateway.c
index 1e8943a..742db0e 100644
--- a/audio/gateway.c
+++ b/audio/gateway.c
@@ -715,7 +715,7 @@ done:
 static GDBusMethodTable gateway_methods[] = {
 	{ "Connect", "", "", ag_connect, G_DBUS_METHOD_FLAG_ASYNC },
 	{ "Disconnect", "", "", ag_disconnect, G_DBUS_METHOD_FLAG_ASYNC },
-	{ "GetProperties", "", "a{sv}", ag_get_properties },
+	{ "GetProperties", "", "a{sv}[properties]", ag_get_properties },
 	{ "RegisterAgent", "o[agent]", "", register_agent },
 	{ "UnregisterAgent", "o[agent]", "", unregister_agent },
 	{ NULL, NULL, NULL, NULL }
diff --git a/audio/headset.c b/audio/headset.c
index 61e09cb..2e465c9 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -2068,15 +2068,15 @@ static GDBusMethodTable headset_methods[] = {
 	{ "Stop",		"",	"",	hs_stop },
 	{ "IsPlaying",		"",	"b",	hs_is_playing,
 						G_DBUS_METHOD_FLAG_DEPRECATED },
-	{ "GetSpeakerGain",	"",	"q",	hs_get_speaker_gain,
+	{ "GetSpeakerGain",	"",	"q[gain]",	hs_get_speaker_gain,
 						G_DBUS_METHOD_FLAG_DEPRECATED },
-	{ "GetMicrophoneGain",	"",	"q",	hs_get_mic_gain,
+	{ "GetMicrophoneGain",	"",	"q[gain]",	hs_get_mic_gain,
 						G_DBUS_METHOD_FLAG_DEPRECATED },
 	{ "SetSpeakerGain",	"q[gain]", "",	hs_set_speaker_gain,
 						G_DBUS_METHOD_FLAG_DEPRECATED },
 	{ "SetMicrophoneGain",	"q[gain]", "",	hs_set_mic_gain,
 						G_DBUS_METHOD_FLAG_DEPRECATED },
-	{ "GetProperties",	"",	"a{sv}",hs_get_properties },
+	{ "GetProperties",	"",	"a{sv}[properties]",hs_get_properties },
 	{ "SetProperty",	"s[name]v[value]", "", hs_set_property },
 	{ NULL, NULL, NULL, NULL }
 };
diff --git a/audio/sink.c b/audio/sink.c
index 790aad4..c33e7ee 100644
--- a/audio/sink.c
+++ b/audio/sink.c
@@ -562,7 +562,7 @@ static GDBusMethodTable sink_methods[] = {
 						G_DBUS_METHOD_FLAG_ASYNC },
 	{ "IsConnected",	"",	"b",	sink_is_connected,
 						G_DBUS_METHOD_FLAG_DEPRECATED },
-	{ "GetProperties",	"",	"a{sv}",sink_get_properties },
+	{ "GetProperties",	"",	"a{sv}[properties]",sink_get_properties },
 	{ NULL, NULL, NULL, NULL }
 };
 
diff --git a/audio/source.c b/audio/source.c
index b9c7b77..b7bdf44 100644
--- a/audio/source.c
+++ b/audio/source.c
@@ -481,7 +481,7 @@ static GDBusMethodTable source_methods[] = {
 						G_DBUS_METHOD_FLAG_ASYNC },
 	{ "Disconnect",		"",	"",	source_disconnect,
 						G_DBUS_METHOD_FLAG_ASYNC },
-	{ "GetProperties",	"",	"a{sv}",source_get_properties },
+	{ "GetProperties",	"",	"a{sv}[properties]",source_get_properties },
 	{ NULL, NULL, NULL, NULL }
 };
 
diff --git a/audio/transport.c b/audio/transport.c
index ae2c3f9..3b5ed47 100644
--- a/audio/transport.c
+++ b/audio/transport.c
@@ -915,8 +915,8 @@ static DBusMessage *get_properties(DBusConnection *conn, DBusMessage *msg,
 }
 
 static GDBusMethodTable transport_methods[] = {
-	{ "GetProperties",	"",	"a{sv}",	get_properties },
-	{ "Acquire",		"s[accesstype]", "hqq", acquire,
+	{ "GetProperties",	"",	"a{sv}[properties]",	get_properties },
+	{ "Acquire",		"s[accesstype]", "h[fd]q[mtu_r]q[mtu_w]", acquire,
 						G_DBUS_METHOD_FLAG_ASYNC},
 	{ "Release",		"s[accesstype]", "", release,
 						G_DBUS_METHOD_FLAG_ASYNC},
diff --git a/gdbus/object.c b/gdbus/object.c
index bae6e7f..acbaad0 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -529,7 +529,7 @@ done:
 }
 
 static GDBusMethodTable introspect_methods[] = {
-	{ "Introspect",	"",	"s", introspect	},
+	{ "Introspect",	"",	"s[xml]", introspect	},
 	{ }
 };
 
diff --git a/health/hdp.c b/health/hdp.c
index 2723910..fc144cc 100644
--- a/health/hdp.c
+++ b/health/hdp.c
@@ -425,7 +425,7 @@ static void manager_path_unregister(gpointer data)
 }
 
 static GDBusMethodTable health_manager_methods[] = {
-	{"CreateApplication", "a{sv}[config]", "o", manager_create_application},
+	{"CreateApplication", "a{sv}[config]", "o[application]", manager_create_application},
 	{"DestroyApplication", "o[application]", "", manager_destroy_application},
 	{ NULL }
 };
@@ -732,8 +732,8 @@ end:
 }
 
 static GDBusMethodTable health_channels_methods[] = {
-	{"GetProperties","",	"a{sv}",	channel_get_properties },
-	{"Acquire",	"",	"h",		channel_acquire,
+	{"GetProperties","",	"a{sv}[properties]",	channel_get_properties },
+	{"Acquire",	"",	"h[fd]",		channel_acquire,
 						G_DBUS_METHOD_FLAG_ASYNC },
 	{"Release",	"",	"",		channel_release },
 	{ NULL }
@@ -2096,11 +2096,11 @@ static void health_device_destroy(void *data)
 static GDBusMethodTable health_device_methods[] = {
 	{"Echo",		"",	"b",	device_echo,
 						G_DBUS_METHOD_FLAG_ASYNC },
-	{"CreateChannel", "o[application]s[configuration]", "o", device_create_channel,
+	{"CreateChannel", "o[application]s[configuration]", "o[channel]", device_create_channel,
 						G_DBUS_METHOD_FLAG_ASYNC },
 	{"DestroyChannel", "o[channel]", "", device_destroy_channel,
 						G_DBUS_METHOD_FLAG_ASYNC },
-	{"GetProperties",	"",	"a{sv}", device_get_properties},
+	{"GetProperties",	"",	"a{sv}[properties]", device_get_properties},
 	{ NULL }
 };
 
diff --git a/input/device.c b/input/device.c
index a30e0e5..602d7c5 100644
--- a/input/device.c
+++ b/input/device.c
@@ -1023,7 +1023,7 @@ static GDBusMethodTable device_methods[] = {
 	{ "Connect",		"",	"",	input_device_connect,
 						G_DBUS_METHOD_FLAG_ASYNC },
 	{ "Disconnect",		"",	"",	input_device_disconnect	},
-	{ "GetProperties",	"",	"a{sv}",input_device_get_properties },
+	{ "GetProperties",	"",	"a{sv}[properties]", input_device_get_properties },
 	{ }
 };
 
diff --git a/network/connection.c b/network/connection.c
index b4c3288..282234e 100644
--- a/network/connection.c
+++ b/network/connection.c
@@ -553,10 +553,10 @@ static void path_unregister(void *data)
 }
 
 static GDBusMethodTable connection_methods[] = {
-	{ "Connect",		"s[uuid]",	"s",	connection_connect,
+	{ "Connect", "s[uuid]", "s[interface_name]", connection_connect,
 						G_DBUS_METHOD_FLAG_ASYNC },
 	{ "Disconnect",		"",	"",	connection_disconnect	},
-	{ "GetProperties",	"",	"a{sv}",connection_get_properties },
+	{ "GetProperties",	"",	"a{sv}[properties]",connection_get_properties },
 	{ }
 };
 
diff --git a/plugins/dbusoob.c b/plugins/dbusoob.c
index 1612fab..d147b1b 100644
--- a/plugins/dbusoob.c
+++ b/plugins/dbusoob.c
@@ -178,7 +178,7 @@ static DBusMessage *remove_remote_data(DBusConnection *conn, DBusMessage *msg,
 static GDBusMethodTable oob_methods[] = {
 	{"AddRemoteData", "s[address]ay[hash]ay[randomizer]", "", add_remote_data},
 	{"RemoveRemoteData", "s[address]", "", remove_remote_data},
-	{"ReadLocalData",	"",		"ayay",	read_local_data,
+	{"ReadLocalData", "", "ay[hash]ay[randomizer]", read_local_data,
 						G_DBUS_METHOD_FLAG_ASYNC},
 	{}
 };
diff --git a/proximity/monitor.c b/proximity/monitor.c
index 903ab69..a2f1479 100644
--- a/proximity/monitor.c
+++ b/proximity/monitor.c
@@ -547,7 +547,7 @@ static DBusMessage *set_property(DBusConnection *conn,
 }
 
 static GDBusMethodTable monitor_methods[] = {
-	{ "GetProperties",	"",	"a{sv}",	get_properties	},
+	{ "GetProperties", "", "a{sv}[properties]", get_properties	},
 	{ "SetProperty",	"s[name]v[value]", "", set_property,
 						G_DBUS_METHOD_FLAG_ASYNC},
 	{ }
diff --git a/proximity/reporter.c b/proximity/reporter.c
index ac32ef7..cc4920c 100644
--- a/proximity/reporter.c
+++ b/proximity/reporter.c
@@ -181,7 +181,7 @@ err:
 }
 
 static GDBusMethodTable reporter_methods[] = {
-	{ "GetProperties",	"",	"a{sv}",	get_properties	},
+	{ "GetProperties",	"",	"a{sv}[properties]",	get_properties	},
 	{ }
 };
 
diff --git a/sap/server.c b/sap/server.c
index e0fcd9b..fdedd83 100644
--- a/sap/server.c
+++ b/sap/server.c
@@ -1304,7 +1304,7 @@ static DBusMessage *get_properties(DBusConnection *c,
 }
 
 static GDBusMethodTable server_methods[] = {
-	{"GetProperties", "", "a{sv}", get_properties},
+	{"GetProperties", "", "a{sv}[properties]", get_properties},
 	{"Disconnect", "", "", disconnect},
 	{ }
 };
diff --git a/serial/port.c b/serial/port.c
index e7ec22b..e6b6957 100644
--- a/serial/port.c
+++ b/serial/port.c
@@ -568,8 +568,8 @@ static DBusMessage *port_disconnect(DBusConnection *conn,
 }
 
 static GDBusMethodTable port_methods[] = {
-	{ "Connect", "s[pattern]", "s", port_connect, G_DBUS_METHOD_FLAG_ASYNC },
-	{ "ConnectFD", "s[pattern]", "h", port_connect, G_DBUS_METHOD_FLAG_ASYNC },
+	{ "Connect", "s[pattern]", "s[tty]", port_connect, G_DBUS_METHOD_FLAG_ASYNC },
+	{ "ConnectFD", "s[pattern]", "h[fd]", port_connect, G_DBUS_METHOD_FLAG_ASYNC },
 	{ "Disconnect", "s[device]", "",  port_disconnect },
 	{ }
 };
diff --git a/serial/proxy.c b/serial/proxy.c
index b5631c7..3dd9fbf 100644
--- a/serial/proxy.c
+++ b/serial/proxy.c
@@ -731,7 +731,7 @@ static DBusMessage *proxy_set_serial_params(DBusConnection *conn,
 static GDBusMethodTable proxy_methods[] = {
 	{ "Enable",			"",	"",	proxy_enable },
 	{ "Disable",			"",	"",	proxy_disable },
-	{ "GetInfo",			"",	"a{sv}",proxy_get_info },
+	{ "GetInfo", "", "a{sv}[properties]", proxy_get_info },
 	{ "SetSerialParameters", "s[rate]y[data]y[stop]s[parity]", "", proxy_set_serial_params },
 	{ },
 };
@@ -1112,8 +1112,8 @@ static void manager_path_unregister(void *data)
 }
 
 static GDBusMethodTable manager_methods[] = {
-	{ "CreateProxy", "s[pattern]s[address]", "s", create_proxy },
-	{ "ListProxies", "", "as", list_proxies },
+	{ "CreateProxy", "s[pattern]s[address]", "s[path]", create_proxy },
+	{ "ListProxies", "", "as[paths]", list_proxies },
 	{ "RemoveProxy", "s[path]", "", remove_proxy },
 	{ },
 };
diff --git a/src/adapter.c b/src/adapter.c
index d89ab16..d219f7d 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -1660,7 +1660,7 @@ static DBusMessage *unregister_agent(DBusConnection *conn, DBusMessage *msg,
 }
 
 static GDBusMethodTable adapter_methods[] = {
-	{ "GetProperties",	"",	"a{sv}",get_properties		},
+	{ "GetProperties",	"",	"a{sv}[properties]",get_properties },
 	{ "SetProperty", "s[name]v[value]",	"",	set_property,
 						G_DBUS_METHOD_FLAG_ASYNC},
 	{ "RequestSession",	"",	"",	request_session,
@@ -1669,17 +1669,17 @@ static GDBusMethodTable adapter_methods[] = {
 	{ "StartDiscovery",	"",	"",	adapter_start_discovery },
 	{ "StopDiscovery",	"",	"",	adapter_stop_discovery,
 						G_DBUS_METHOD_FLAG_ASYNC},
-	{ "ListDevices",	"",	"ao",	list_devices,
+	{ "ListDevices",	"",	"ao[devices]",	list_devices,
 						G_DBUS_METHOD_FLAG_DEPRECATED},
-	{ "CreateDevice", "s[address]", "o",	create_device,
+	{ "CreateDevice", "s[address]", "o[device]",	create_device,
 						G_DBUS_METHOD_FLAG_ASYNC},
-	{ "CreatePairedDevice", "s[address]o[agent]s[capability]", "o",
+	{ "CreatePairedDevice", "s[address]o[agent]s[capability]", "o[device]",
 			create_paired_device, G_DBUS_METHOD_FLAG_ASYNC},
 	{ "CancelDeviceCreation","s[address]", "", cancel_device_creation,
 						G_DBUS_METHOD_FLAG_ASYNC},
 	{ "RemoveDevice", "o[device]", "", remove_device,
 						G_DBUS_METHOD_FLAG_ASYNC},
-	{ "FindDevice",	"s[address]", "o", find_device },
+	{ "FindDevice",	"s[address]", "o[device]", find_device },
 	{ "RegisterAgent", "o[agent]s[capability]", "", register_agent },
 	{ "UnregisterAgent", "o[agent]", "", unregister_agent },
 	{ }
diff --git a/src/device.c b/src/device.c
index 3f5d826..50086ca 100644
--- a/src/device.c
+++ b/src/device.c
@@ -878,9 +878,9 @@ static DBusMessage *disconnect(DBusConnection *conn, DBusMessage *msg,
 }
 
 static GDBusMethodTable device_methods[] = {
-	{ "GetProperties",	"",	"a{sv}",	get_properties	},
+	{ "GetProperties",	"",	"a{sv}[properties]", get_properties },
 	{ "SetProperty", "s[name]v[value]", "",		set_property	},
-	{ "DiscoverServices", "s[pattern]", "a{us}", discover_services,
+	{ "DiscoverServices", "s[pattern]", "a{us}[services]", discover_services,
 						G_DBUS_METHOD_FLAG_ASYNC},
 	{ "CancelDiscovery",	"",	"",		cancel_discover	},
 	{ "Disconnect",		"",	"",		disconnect,
diff --git a/src/manager.c b/src/manager.c
index 258f966..57833f0 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -197,10 +197,10 @@ static DBusMessage *get_properties(DBusConnection *conn,
 }
 
 static GDBusMethodTable manager_methods[] = {
-	{ "GetProperties",	"",	"a{sv}",get_properties	},
-	{ "DefaultAdapter",	"",	"o",	default_adapter	},
-	{ "FindAdapter", "s[pattern]", "o", find_adapter },
-	{ "ListAdapters",	"",	"ao",	list_adapters,
+	{ "GetProperties",	"",	"a{sv}[properties]",get_properties	},
+	{ "DefaultAdapter",	"",	"o[adapter]",	default_adapter	},
+	{ "FindAdapter", "s[pattern]", "o[adapter]", find_adapter },
+	{ "ListAdapters",	"",	"ao[adapters]",	list_adapters,
 						G_DBUS_METHOD_FLAG_DEPRECATED},
 	{ }
 };
diff --git a/thermometer/thermometer.c b/thermometer/thermometer.c
index 6fbb528..09760fd 100644
--- a/thermometer/thermometer.c
+++ b/thermometer/thermometer.c
@@ -960,7 +960,7 @@ static DBusMessage *disable_intermediate(DBusConnection *conn, DBusMessage *msg,
 }
 
 static GDBusMethodTable thermometer_methods[] = {
-	{ "GetProperties", "", "a{sv}", get_properties },
+	{ "GetProperties", "", "a{sv}[properties]", get_properties },
 	{ "SetProperty", "s[name]v[value]", "", set_property,
 						G_DBUS_METHOD_FLAG_ASYNC },
 	{ "RegisterWatcher", "o[agent]", "", register_watcher },
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [BlueZ v3 07/10] gdbus: add Deprecated annotation to introspection
  2012-04-27 21:14 [BlueZ v3 00/10] gdbus: Better D-Bus introspection Lucas De Marchi
                   ` (5 preceding siblings ...)
  2012-04-27 21:14 ` [BlueZ v3 06/10] gdbus: add decorated signature to return values Lucas De Marchi
@ 2012-04-27 21:14 ` Lucas De Marchi
  2012-04-27 21:14 ` [BlueZ v3 08/10] gdbus: add Method.NoReply " Lucas De Marchi
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Lucas De Marchi @ 2012-04-27 21:14 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Lucas De Marchi

---
 gdbus/object.c |   18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/gdbus/object.c b/gdbus/object.c
index acbaad0..52803c0 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -160,7 +160,10 @@ static void generate_interface_xml(GString *gstr, struct interface_data *iface)
 	const GDBusSignalTable *signal;
 
 	for (method = iface->methods; method && method->name; method++) {
-		if (!strlen(method->decorated_signature) &&
+		gboolean deprecated = method->flags &
+						G_DBUS_METHOD_FLAG_DEPRECATED;
+
+		if (!deprecated && !strlen(method->decorated_signature) &&
 					!strlen(method->decorated_reply))
 			g_string_append_printf(gstr, "\t\t<method name=\"%s\"/>\n",
 								method->name);
@@ -169,18 +172,29 @@ static void generate_interface_xml(GString *gstr, struct interface_data *iface)
 								method->name);
 			print_arguments(gstr, method->decorated_signature, "in");
 			print_arguments(gstr, method->decorated_reply, "out");
+
+			if (deprecated)
+				g_string_append_printf(gstr, "\t\t\t<annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>\n");
+
 			g_string_append_printf(gstr, "\t\t</method>\n");
 		}
 	}
 
 	for (signal = iface->signals; signal && signal->name; signal++) {
-		if (!strlen(signal->decorated_signature))
+		gboolean deprecated = signal->flags &
+						G_DBUS_SIGNAL_FLAG_DEPRECATED;
+
+		if (!deprecated && !strlen(signal->decorated_signature))
 			g_string_append_printf(gstr, "\t\t<signal name=\"%s\"/>\n",
 								signal->name);
 		else {
 			g_string_append_printf(gstr, "\t\t<signal name=\"%s\">\n",
 								signal->name);
 			print_arguments(gstr, signal->decorated_signature, NULL);
+
+			if (deprecated)
+				g_string_append_printf(gstr, "\t\t\t<annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>\n");
+
 			g_string_append_printf(gstr, "\t\t</signal>\n");
 		}
 	}
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [BlueZ v3 08/10] gdbus: add Method.NoReply annotation to introspection
  2012-04-27 21:14 [BlueZ v3 00/10] gdbus: Better D-Bus introspection Lucas De Marchi
                   ` (6 preceding siblings ...)
  2012-04-27 21:14 ` [BlueZ v3 07/10] gdbus: add Deprecated annotation to introspection Lucas De Marchi
@ 2012-04-27 21:14 ` Lucas De Marchi
  2012-04-27 21:14 ` [BlueZ v3 09/10] Constify GDBus method tables Lucas De Marchi
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Lucas De Marchi @ 2012-04-27 21:14 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Lucas De Marchi

---
 gdbus/object.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gdbus/object.c b/gdbus/object.c
index 52803c0..1a75b45 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -163,6 +163,9 @@ static void generate_interface_xml(GString *gstr, struct interface_data *iface)
 		gboolean deprecated = method->flags &
 						G_DBUS_METHOD_FLAG_DEPRECATED;
 
+		gboolean noreply = method->flags &
+						G_DBUS_METHOD_FLAG_NOREPLY;
+
 		if (!deprecated && !strlen(method->decorated_signature) &&
 					!strlen(method->decorated_reply))
 			g_string_append_printf(gstr, "\t\t<method name=\"%s\"/>\n",
@@ -176,6 +179,10 @@ static void generate_interface_xml(GString *gstr, struct interface_data *iface)
 			if (deprecated)
 				g_string_append_printf(gstr, "\t\t\t<annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>\n");
 
+			if (noreply)
+				g_string_append_printf(gstr, "\t\t\t<annotation name=\"org.freedesktop.DBus.Method.NoReply\" value=\"true\"/>\n");
+
+
 			g_string_append_printf(gstr, "\t\t</method>\n");
 		}
 	}
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [BlueZ v3 09/10] Constify GDBus method tables
  2012-04-27 21:14 [BlueZ v3 00/10] gdbus: Better D-Bus introspection Lucas De Marchi
                   ` (7 preceding siblings ...)
  2012-04-27 21:14 ` [BlueZ v3 08/10] gdbus: add Method.NoReply " Lucas De Marchi
@ 2012-04-27 21:14 ` Lucas De Marchi
  2012-04-27 21:14 ` [BlueZ v3 10/10] Constify GDBus signal tables Lucas De Marchi
  2012-04-29 11:52 ` [BlueZ v3 00/10] gdbus: Better D-Bus introspection Luiz Augusto von Dentz
  10 siblings, 0 replies; 15+ messages in thread
From: Lucas De Marchi @ 2012-04-27 21:14 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Lucas De Marchi

---
 attrib/client.c           |    4 ++--
 audio/control.c           |    2 +-
 audio/device.c            |    2 +-
 audio/gateway.c           |    2 +-
 audio/headset.c           |    2 +-
 audio/media.c             |    2 +-
 audio/sink.c              |    2 +-
 audio/source.c            |    2 +-
 audio/telephony-dummy.c   |    2 +-
 audio/telephony-maemo5.c  |    2 +-
 audio/transport.c         |    2 +-
 gdbus/object.c            |    2 +-
 health/hdp.c              |    6 +++---
 input/device.c            |    2 +-
 network/connection.c      |    2 +-
 network/server.c          |    2 +-
 plugins/dbusoob.c         |    2 +-
 plugins/service.c         |    2 +-
 proximity/monitor.c       |    2 +-
 proximity/reporter.c      |    2 +-
 sap/sap-dummy.c           |    2 +-
 sap/server.c              |    2 +-
 serial/port.c             |    2 +-
 serial/proxy.c            |    4 ++--
 src/adapter.c             |    2 +-
 src/device.c              |    2 +-
 src/manager.c             |    2 +-
 thermometer/thermometer.c |    2 +-
 28 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/attrib/client.c b/attrib/client.c
index 7d3c3a5..7c9dc7a 100644
--- a/attrib/client.c
+++ b/attrib/client.c
@@ -515,7 +515,7 @@ static DBusMessage *set_property(DBusConnection *conn,
 	return btd_error_invalid_args(msg);
 }
 
-static GDBusMethodTable char_methods[] = {
+static const GDBusMethodTable char_methods[] = {
 	{ "GetProperties",	"",	"a{sv}[properties]", get_properties },
 	{ "SetProperty", "s[name]v[value]", "", set_property,
 						G_DBUS_METHOD_FLAG_ASYNC},
@@ -1015,7 +1015,7 @@ static DBusMessage *prim_get_properties(DBusConnection *conn, DBusMessage *msg,
 	return reply;
 }
 
-static GDBusMethodTable prim_methods[] = {
+static const GDBusMethodTable prim_methods[] = {
 	{ "DiscoverCharacteristics",	"",	"ao",	discover_char,
 					G_DBUS_METHOD_FLAG_ASYNC	},
 	{ "RegisterCharacteristicsWatcher",	"o[agent]", "",
diff --git a/audio/control.c b/audio/control.c
index 23bca56..650239c 100644
--- a/audio/control.c
+++ b/audio/control.c
@@ -197,7 +197,7 @@ static DBusMessage *control_get_properties(DBusConnection *conn,
 	return reply;
 }
 
-static GDBusMethodTable control_methods[] = {
+static const GDBusMethodTable control_methods[] = {
 	{ "IsConnected",	"",	"b",	control_is_connected,
 						G_DBUS_METHOD_FLAG_DEPRECATED },
 	{ "GetProperties",	"",	"a{sv}",control_get_properties },
diff --git a/audio/device.c b/audio/device.c
index 09cc0b1..1ede250 100644
--- a/audio/device.c
+++ b/audio/device.c
@@ -618,7 +618,7 @@ static DBusMessage *dev_get_properties(DBusConnection *conn, DBusMessage *msg,
 	return reply;
 }
 
-static GDBusMethodTable dev_methods[] = {
+static const GDBusMethodTable dev_methods[] = {
 	{ "Connect",		"",	"",	dev_connect,
 						G_DBUS_METHOD_FLAG_ASYNC },
 	{ "Disconnect",		"",	"",	dev_disconnect },
diff --git a/audio/gateway.c b/audio/gateway.c
index 742db0e..d5fef0d 100644
--- a/audio/gateway.c
+++ b/audio/gateway.c
@@ -712,7 +712,7 @@ done:
 	return dbus_message_new_method_return(msg);
 }
 
-static GDBusMethodTable gateway_methods[] = {
+static const GDBusMethodTable gateway_methods[] = {
 	{ "Connect", "", "", ag_connect, G_DBUS_METHOD_FLAG_ASYNC },
 	{ "Disconnect", "", "", ag_disconnect, G_DBUS_METHOD_FLAG_ASYNC },
 	{ "GetProperties", "", "a{sv}[properties]", ag_get_properties },
diff --git a/audio/headset.c b/audio/headset.c
index 2e465c9..06dc3b0 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -2055,7 +2055,7 @@ static DBusMessage *hs_set_property(DBusConnection *conn,
 	return btd_error_invalid_args(msg);
 }
 
-static GDBusMethodTable headset_methods[] = {
+static const GDBusMethodTable headset_methods[] = {
 	{ "Connect",		"",	"",	hs_connect,
 						G_DBUS_METHOD_FLAG_ASYNC },
 	{ "Disconnect",		"",	"",	hs_disconnect },
diff --git a/audio/media.c b/audio/media.c
index 6607230..46de99c 100644
--- a/audio/media.c
+++ b/audio/media.c
@@ -1705,7 +1705,7 @@ static DBusMessage *unregister_player(DBusConnection *conn, DBusMessage *msg,
 	return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
 }
 
-static GDBusMethodTable media_methods[] = {
+static const GDBusMethodTable media_methods[] = {
 	{ "RegisterEndpoint", "o[endpoint]a{sv}[properties]", "", register_endpoint },
 	{ "UnregisterEndpoint", "o[endpoint]", "", unregister_endpoint },
 	{ "RegisterPlayer", "o[player]a{sv}[properties]a{sv}[metadata]", "", register_player },
diff --git a/audio/sink.c b/audio/sink.c
index c33e7ee..4db339e 100644
--- a/audio/sink.c
+++ b/audio/sink.c
@@ -555,7 +555,7 @@ static DBusMessage *sink_get_properties(DBusConnection *conn,
 	return reply;
 }
 
-static GDBusMethodTable sink_methods[] = {
+static const GDBusMethodTable sink_methods[] = {
 	{ "Connect",		"",	"",	sink_connect,
 						G_DBUS_METHOD_FLAG_ASYNC },
 	{ "Disconnect",		"",	"",	sink_disconnect,
diff --git a/audio/source.c b/audio/source.c
index b7bdf44..79f42b5 100644
--- a/audio/source.c
+++ b/audio/source.c
@@ -476,7 +476,7 @@ static DBusMessage *source_get_properties(DBusConnection *conn,
 	return reply;
 }
 
-static GDBusMethodTable source_methods[] = {
+static const GDBusMethodTable source_methods[] = {
 	{ "Connect",		"",	"",	source_connect,
 						G_DBUS_METHOD_FLAG_ASYNC },
 	{ "Disconnect",		"",	"",	source_disconnect,
diff --git a/audio/telephony-dummy.c b/audio/telephony-dummy.c
index ec94d17..c0f7ada 100644
--- a/audio/telephony-dummy.c
+++ b/audio/telephony-dummy.c
@@ -378,7 +378,7 @@ static DBusMessage *set_subscriber_number(DBusConnection *conn,
 	return dbus_message_new_method_return(msg);
 }
 
-static GDBusMethodTable dummy_methods[] = {
+static const GDBusMethodTable dummy_methods[] = {
 	{ "OutgoingCall",	"s[number]", "", outgoing_call		},
 	{ "IncomingCall",	"s[number]", "", incoming_call		},
 	{ "CancelCall",		"",	"",	cancel_call		},
diff --git a/audio/telephony-maemo5.c b/audio/telephony-maemo5.c
index 4ee0f24..b7ec679 100644
--- a/audio/telephony-maemo5.c
+++ b/audio/telephony-maemo5.c
@@ -1951,7 +1951,7 @@ static DBusMessage *set_callerid(DBusConnection *conn, DBusMessage *msg,
 		return btd_error_invalid_args(msg);
 }
 
-static GDBusMethodTable telephony_maemo_methods[] = {
+static const GDBusMethodTable telephony_maemo_methods[] = {
 	{"SetCallerId",		"s[id]", "",	set_callerid,
 						G_DBUS_METHOD_FLAG_ASYNC},
 	{ }
diff --git a/audio/transport.c b/audio/transport.c
index 3b5ed47..69dcb32 100644
--- a/audio/transport.c
+++ b/audio/transport.c
@@ -914,7 +914,7 @@ static DBusMessage *get_properties(DBusConnection *conn, DBusMessage *msg,
 	return reply;
 }
 
-static GDBusMethodTable transport_methods[] = {
+static const GDBusMethodTable transport_methods[] = {
 	{ "GetProperties",	"",	"a{sv}[properties]",	get_properties },
 	{ "Acquire",		"s[accesstype]", "h[fd]q[mtu_r]q[mtu_w]", acquire,
 						G_DBUS_METHOD_FLAG_ASYNC},
diff --git a/gdbus/object.c b/gdbus/object.c
index 1a75b45..540d1fc 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -549,7 +549,7 @@ done:
 	g_free(parent_path);
 }
 
-static GDBusMethodTable introspect_methods[] = {
+static const GDBusMethodTable introspect_methods[] = {
 	{ "Introspect",	"",	"s[xml]", introspect	},
 	{ }
 };
diff --git a/health/hdp.c b/health/hdp.c
index fc144cc..9dfd635 100644
--- a/health/hdp.c
+++ b/health/hdp.c
@@ -424,7 +424,7 @@ static void manager_path_unregister(gpointer data)
 	g_slist_foreach(adapters, (GFunc) update_adapter, NULL);
 }
 
-static GDBusMethodTable health_manager_methods[] = {
+static const GDBusMethodTable health_manager_methods[] = {
 	{"CreateApplication", "a{sv}[config]", "o[application]", manager_create_application},
 	{"DestroyApplication", "o[application]", "", manager_destroy_application},
 	{ NULL }
@@ -731,7 +731,7 @@ end:
 	hdp_channel_unref(hdp_chan);
 }
 
-static GDBusMethodTable health_channels_methods[] = {
+static const GDBusMethodTable health_channels_methods[] = {
 	{"GetProperties","",	"a{sv}[properties]",	channel_get_properties },
 	{"Acquire",	"",	"h[fd]",		channel_acquire,
 						G_DBUS_METHOD_FLAG_ASYNC },
@@ -2093,7 +2093,7 @@ static void health_device_destroy(void *data)
 	health_device_unref(device);
 }
 
-static GDBusMethodTable health_device_methods[] = {
+static const GDBusMethodTable health_device_methods[] = {
 	{"Echo",		"",	"b",	device_echo,
 						G_DBUS_METHOD_FLAG_ASYNC },
 	{"CreateChannel", "o[application]s[configuration]", "o[channel]", device_create_channel,
diff --git a/input/device.c b/input/device.c
index 602d7c5..cade3bc 100644
--- a/input/device.c
+++ b/input/device.c
@@ -1019,7 +1019,7 @@ static DBusMessage *input_device_get_properties(DBusConnection *conn,
 	return reply;
 }
 
-static GDBusMethodTable device_methods[] = {
+static const GDBusMethodTable device_methods[] = {
 	{ "Connect",		"",	"",	input_device_connect,
 						G_DBUS_METHOD_FLAG_ASYNC },
 	{ "Disconnect",		"",	"",	input_device_disconnect	},
diff --git a/network/connection.c b/network/connection.c
index 282234e..4895c7d 100644
--- a/network/connection.c
+++ b/network/connection.c
@@ -552,7 +552,7 @@ static void path_unregister(void *data)
 	peer_free(peer);
 }
 
-static GDBusMethodTable connection_methods[] = {
+static const GDBusMethodTable connection_methods[] = {
 	{ "Connect", "s[uuid]", "s[interface_name]", connection_connect,
 						G_DBUS_METHOD_FLAG_ASYNC },
 	{ "Disconnect",		"",	"",	connection_disconnect	},
diff --git a/network/server.c b/network/server.c
index 6cf9e18..15a5816 100644
--- a/network/server.c
+++ b/network/server.c
@@ -685,7 +685,7 @@ static void path_unregister(void *data)
 	adapter_free(na);
 }
 
-static GDBusMethodTable server_methods[] = {
+static const GDBusMethodTable server_methods[] = {
 	{ "Register",	"s[uuid]s[bridge]", "", register_server },
 	{ "Unregister",	"s[uuid]", "", unregister_server },
 	{ }
diff --git a/plugins/dbusoob.c b/plugins/dbusoob.c
index d147b1b..fa2b776 100644
--- a/plugins/dbusoob.c
+++ b/plugins/dbusoob.c
@@ -175,7 +175,7 @@ static DBusMessage *remove_remote_data(DBusConnection *conn, DBusMessage *msg,
 	return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
 }
 
-static GDBusMethodTable oob_methods[] = {
+static const GDBusMethodTable oob_methods[] = {
 	{"AddRemoteData", "s[address]ay[hash]ay[randomizer]", "", add_remote_data},
 	{"RemoveRemoteData", "s[address]", "", remove_remote_data},
 	{"ReadLocalData", "", "ay[hash]ay[randomizer]", read_local_data,
diff --git a/plugins/service.c b/plugins/service.c
index 19fe666..37eb27a 100644
--- a/plugins/service.c
+++ b/plugins/service.c
@@ -696,7 +696,7 @@ done:
 	return dbus_message_new_method_return(msg);
 }
 
-static GDBusMethodTable service_methods[] = {
+static const GDBusMethodTable service_methods[] = {
 	{ "AddRecord", "s[record]", "u", add_service_record },
 	{ "UpdateRecord", "u[handle]s[record]", "", update_service_record	},
 	{ "RemoveRecord", "u[handle]", "", remove_service_record },
diff --git a/proximity/monitor.c b/proximity/monitor.c
index a2f1479..8b103e5 100644
--- a/proximity/monitor.c
+++ b/proximity/monitor.c
@@ -546,7 +546,7 @@ static DBusMessage *set_property(DBusConnection *conn,
 	return btd_error_invalid_args(msg);
 }
 
-static GDBusMethodTable monitor_methods[] = {
+static const GDBusMethodTable monitor_methods[] = {
 	{ "GetProperties", "", "a{sv}[properties]", get_properties	},
 	{ "SetProperty",	"s[name]v[value]", "", set_property,
 						G_DBUS_METHOD_FLAG_ASYNC},
diff --git a/proximity/reporter.c b/proximity/reporter.c
index cc4920c..511c7a4 100644
--- a/proximity/reporter.c
+++ b/proximity/reporter.c
@@ -180,7 +180,7 @@ err:
 	return btd_error_failed(msg, "not enough memory");
 }
 
-static GDBusMethodTable reporter_methods[] = {
+static const GDBusMethodTable reporter_methods[] = {
 	{ "GetProperties",	"",	"a{sv}[properties]",	get_properties	},
 	{ }
 };
diff --git a/sap/sap-dummy.c b/sap/sap-dummy.c
index 6c4af62..5d3f7d6 100644
--- a/sap/sap-dummy.c
+++ b/sap/sap-dummy.c
@@ -315,7 +315,7 @@ static DBusMessage *card_status(DBusConnection *conn, DBusMessage *msg,
 	return dbus_message_new_method_return(msg);
 }
 
-static GDBusMethodTable dummy_methods[] = {
+static const GDBusMethodTable dummy_methods[] = {
 	{ "OngoingCall", "b[ongoing]", "", ongoing_call},
 	{ "MaxMessageSize", "u[size]", "", max_msg_size},
 	{ "DisconnectImmediate", "", "", disconnect_immediate},
diff --git a/sap/server.c b/sap/server.c
index fdedd83..90b007e 100644
--- a/sap/server.c
+++ b/sap/server.c
@@ -1303,7 +1303,7 @@ static DBusMessage *get_properties(DBusConnection *c,
 	return reply;
 }
 
-static GDBusMethodTable server_methods[] = {
+static const GDBusMethodTable server_methods[] = {
 	{"GetProperties", "", "a{sv}[properties]", get_properties},
 	{"Disconnect", "", "", disconnect},
 	{ }
diff --git a/serial/port.c b/serial/port.c
index e6b6957..89468e3 100644
--- a/serial/port.c
+++ b/serial/port.c
@@ -567,7 +567,7 @@ static DBusMessage *port_disconnect(DBusConnection *conn,
 	return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
 }
 
-static GDBusMethodTable port_methods[] = {
+static const GDBusMethodTable port_methods[] = {
 	{ "Connect", "s[pattern]", "s[tty]", port_connect, G_DBUS_METHOD_FLAG_ASYNC },
 	{ "ConnectFD", "s[pattern]", "h[fd]", port_connect, G_DBUS_METHOD_FLAG_ASYNC },
 	{ "Disconnect", "s[device]", "",  port_disconnect },
diff --git a/serial/proxy.c b/serial/proxy.c
index 3dd9fbf..d6cfa2d 100644
--- a/serial/proxy.c
+++ b/serial/proxy.c
@@ -728,7 +728,7 @@ static DBusMessage *proxy_set_serial_params(DBusConnection *conn,
 	return dbus_message_new_method_return(msg);
 }
 
-static GDBusMethodTable proxy_methods[] = {
+static const GDBusMethodTable proxy_methods[] = {
 	{ "Enable",			"",	"",	proxy_enable },
 	{ "Disable",			"",	"",	proxy_disable },
 	{ "GetInfo", "", "a{sv}[properties]", proxy_get_info },
@@ -1111,7 +1111,7 @@ static void manager_path_unregister(void *data)
 	g_free(adapter);
 }
 
-static GDBusMethodTable manager_methods[] = {
+static const GDBusMethodTable manager_methods[] = {
 	{ "CreateProxy", "s[pattern]s[address]", "s[path]", create_proxy },
 	{ "ListProxies", "", "as[paths]", list_proxies },
 	{ "RemoveProxy", "s[path]", "", remove_proxy },
diff --git a/src/adapter.c b/src/adapter.c
index d219f7d..16a11c5 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -1659,7 +1659,7 @@ static DBusMessage *unregister_agent(DBusConnection *conn, DBusMessage *msg,
 	return dbus_message_new_method_return(msg);
 }
 
-static GDBusMethodTable adapter_methods[] = {
+static const GDBusMethodTable adapter_methods[] = {
 	{ "GetProperties",	"",	"a{sv}[properties]",get_properties },
 	{ "SetProperty", "s[name]v[value]",	"",	set_property,
 						G_DBUS_METHOD_FLAG_ASYNC},
diff --git a/src/device.c b/src/device.c
index 50086ca..e2a83f7 100644
--- a/src/device.c
+++ b/src/device.c
@@ -877,7 +877,7 @@ static DBusMessage *disconnect(DBusConnection *conn, DBusMessage *msg,
 	return NULL;
 }
 
-static GDBusMethodTable device_methods[] = {
+static const GDBusMethodTable device_methods[] = {
 	{ "GetProperties",	"",	"a{sv}[properties]", get_properties },
 	{ "SetProperty", "s[name]v[value]", "",		set_property	},
 	{ "DiscoverServices", "s[pattern]", "a{us}[services]", discover_services,
diff --git a/src/manager.c b/src/manager.c
index 57833f0..ef9150c 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -196,7 +196,7 @@ static DBusMessage *get_properties(DBusConnection *conn,
 	return reply;
 }
 
-static GDBusMethodTable manager_methods[] = {
+static const GDBusMethodTable manager_methods[] = {
 	{ "GetProperties",	"",	"a{sv}[properties]",get_properties	},
 	{ "DefaultAdapter",	"",	"o[adapter]",	default_adapter	},
 	{ "FindAdapter", "s[pattern]", "o[adapter]", find_adapter },
diff --git a/thermometer/thermometer.c b/thermometer/thermometer.c
index 09760fd..674150d 100644
--- a/thermometer/thermometer.c
+++ b/thermometer/thermometer.c
@@ -959,7 +959,7 @@ static DBusMessage *disable_intermediate(DBusConnection *conn, DBusMessage *msg,
 	return dbus_message_new_method_return(msg);
 }
 
-static GDBusMethodTable thermometer_methods[] = {
+static const GDBusMethodTable thermometer_methods[] = {
 	{ "GetProperties", "", "a{sv}[properties]", get_properties },
 	{ "SetProperty", "s[name]v[value]", "", set_property,
 						G_DBUS_METHOD_FLAG_ASYNC },
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [BlueZ v3 10/10] Constify GDBus signal tables
  2012-04-27 21:14 [BlueZ v3 00/10] gdbus: Better D-Bus introspection Lucas De Marchi
                   ` (8 preceding siblings ...)
  2012-04-27 21:14 ` [BlueZ v3 09/10] Constify GDBus method tables Lucas De Marchi
@ 2012-04-27 21:14 ` Lucas De Marchi
  2012-04-29 11:52 ` [BlueZ v3 00/10] gdbus: Better D-Bus introspection Luiz Augusto von Dentz
  10 siblings, 0 replies; 15+ messages in thread
From: Lucas De Marchi @ 2012-04-27 21:14 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Lucas De Marchi

---
 audio/control.c           |    2 +-
 audio/device.c            |    2 +-
 audio/gateway.c           |    2 +-
 audio/headset.c           |    2 +-
 audio/sink.c              |    2 +-
 audio/source.c            |    2 +-
 audio/telephony-dummy.c   |    2 +-
 audio/transport.c         |    2 +-
 health/hdp.c              |    2 +-
 input/device.c            |    2 +-
 network/connection.c      |    2 +-
 proximity/monitor.c       |    2 +-
 proximity/reporter.c      |    2 +-
 sap/server.c              |    2 +-
 serial/proxy.c            |    2 +-
 src/adapter.c             |    2 +-
 src/device.c              |    2 +-
 src/manager.c             |    2 +-
 thermometer/thermometer.c |    2 +-
 19 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/audio/control.c b/audio/control.c
index 650239c..aeee4c5 100644
--- a/audio/control.c
+++ b/audio/control.c
@@ -206,7 +206,7 @@ static const GDBusMethodTable control_methods[] = {
 	{ NULL, NULL, NULL, NULL }
 };
 
-static GDBusSignalTable control_signals[] = {
+static const GDBusSignalTable control_signals[] = {
 	{ "Connected",			"",	G_DBUS_SIGNAL_FLAG_DEPRECATED},
 	{ "Disconnected",		"",	G_DBUS_SIGNAL_FLAG_DEPRECATED},
 	{ "PropertyChanged",		"s[name]v[value]"	},
diff --git a/audio/device.c b/audio/device.c
index 1ede250..3a4632d 100644
--- a/audio/device.c
+++ b/audio/device.c
@@ -626,7 +626,7 @@ static const GDBusMethodTable dev_methods[] = {
 	{ NULL, NULL, NULL, NULL }
 };
 
-static GDBusSignalTable dev_signals[] = {
+static const GDBusSignalTable dev_signals[] = {
 	{ "PropertyChanged",		"s[name]v[value]"	},
 	{ NULL, NULL }
 };
diff --git a/audio/gateway.c b/audio/gateway.c
index d5fef0d..677e16a 100644
--- a/audio/gateway.c
+++ b/audio/gateway.c
@@ -721,7 +721,7 @@ static const GDBusMethodTable gateway_methods[] = {
 	{ NULL, NULL, NULL, NULL }
 };
 
-static GDBusSignalTable gateway_signals[] = {
+static const GDBusSignalTable gateway_signals[] = {
 	{ "PropertyChanged", "s[name]v[value]" },
 	{ NULL, NULL }
 };
diff --git a/audio/headset.c b/audio/headset.c
index 06dc3b0..9117047 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -2081,7 +2081,7 @@ static const GDBusMethodTable headset_methods[] = {
 	{ NULL, NULL, NULL, NULL }
 };
 
-static GDBusSignalTable headset_signals[] = {
+static const GDBusSignalTable headset_signals[] = {
 	{ "Connected",			"",	G_DBUS_SIGNAL_FLAG_DEPRECATED },
 	{ "Disconnected",		"",	G_DBUS_SIGNAL_FLAG_DEPRECATED },
 	{ "AnswerRequested",		""	},
diff --git a/audio/sink.c b/audio/sink.c
index 4db339e..8b27142 100644
--- a/audio/sink.c
+++ b/audio/sink.c
@@ -566,7 +566,7 @@ static const GDBusMethodTable sink_methods[] = {
 	{ NULL, NULL, NULL, NULL }
 };
 
-static GDBusSignalTable sink_signals[] = {
+static const GDBusSignalTable sink_signals[] = {
 	{ "Connected",			"",	G_DBUS_SIGNAL_FLAG_DEPRECATED },
 	{ "Disconnected",		"",	G_DBUS_SIGNAL_FLAG_DEPRECATED },
 	{ "Playing",			"",	G_DBUS_SIGNAL_FLAG_DEPRECATED },
diff --git a/audio/source.c b/audio/source.c
index 79f42b5..37dd6a5 100644
--- a/audio/source.c
+++ b/audio/source.c
@@ -485,7 +485,7 @@ static const GDBusMethodTable source_methods[] = {
 	{ NULL, NULL, NULL, NULL }
 };
 
-static GDBusSignalTable source_signals[] = {
+static const GDBusSignalTable source_signals[] = {
 	{ "PropertyChanged",		"s[name]v[value]"	},
 	{ NULL, NULL }
 };
diff --git a/audio/telephony-dummy.c b/audio/telephony-dummy.c
index c0f7ada..de618f3 100644
--- a/audio/telephony-dummy.c
+++ b/audio/telephony-dummy.c
@@ -390,7 +390,7 @@ static const GDBusMethodTable dummy_methods[] = {
 	{ }
 };
 
-static GDBusSignalTable dummy_signals[] = {
+static const GDBusSignalTable dummy_signals[] = {
 	{ "VoiceDial",	"" },
 	{ }
 };
diff --git a/audio/transport.c b/audio/transport.c
index 69dcb32..fbe3a0b 100644
--- a/audio/transport.c
+++ b/audio/transport.c
@@ -924,7 +924,7 @@ static const GDBusMethodTable transport_methods[] = {
 	{ },
 };
 
-static GDBusSignalTable transport_signals[] = {
+static const GDBusSignalTable transport_signals[] = {
 	{ "PropertyChanged",	"s[name]v[value]" },
 	{ }
 };
diff --git a/health/hdp.c b/health/hdp.c
index 9dfd635..5cebc29 100644
--- a/health/hdp.c
+++ b/health/hdp.c
@@ -2104,7 +2104,7 @@ static const GDBusMethodTable health_device_methods[] = {
 	{ NULL }
 };
 
-static GDBusSignalTable health_device_signals[] = {
+static const GDBusSignalTable health_device_signals[] = {
 	{"ChannelConnected",		"o[channel]"		},
 	{"ChannelDeleted",		"o[channel]"		},
 	{"PropertyChanged",		"s[name]v[value]"	},
diff --git a/input/device.c b/input/device.c
index cade3bc..5b14d6e 100644
--- a/input/device.c
+++ b/input/device.c
@@ -1027,7 +1027,7 @@ static const GDBusMethodTable device_methods[] = {
 	{ }
 };
 
-static GDBusSignalTable device_signals[] = {
+static const GDBusSignalTable device_signals[] = {
 	{ "PropertyChanged",	"s[name]v[value]"	},
 	{ }
 };
diff --git a/network/connection.c b/network/connection.c
index 4895c7d..0eb5cb9 100644
--- a/network/connection.c
+++ b/network/connection.c
@@ -560,7 +560,7 @@ static const GDBusMethodTable connection_methods[] = {
 	{ }
 };
 
-static GDBusSignalTable connection_signals[] = {
+static const GDBusSignalTable connection_signals[] = {
 	{ "PropertyChanged",	"s[name]v[value]"	},
 	{ }
 };
diff --git a/proximity/monitor.c b/proximity/monitor.c
index 8b103e5..c255342 100644
--- a/proximity/monitor.c
+++ b/proximity/monitor.c
@@ -553,7 +553,7 @@ static const GDBusMethodTable monitor_methods[] = {
 	{ }
 };
 
-static GDBusSignalTable monitor_signals[] = {
+static const GDBusSignalTable monitor_signals[] = {
 	{ "PropertyChanged",	"s[name]v[value]"	},
 	{ }
 };
diff --git a/proximity/reporter.c b/proximity/reporter.c
index 511c7a4..2a3274c 100644
--- a/proximity/reporter.c
+++ b/proximity/reporter.c
@@ -185,7 +185,7 @@ static const GDBusMethodTable reporter_methods[] = {
 	{ }
 };
 
-static GDBusSignalTable reporter_signals[] = {
+static const GDBusSignalTable reporter_signals[] = {
 	{ "PropertyChanged",	"s[name]v[value]"	},
 	{ }
 };
diff --git a/sap/server.c b/sap/server.c
index 90b007e..6331075 100644
--- a/sap/server.c
+++ b/sap/server.c
@@ -1309,7 +1309,7 @@ static const GDBusMethodTable server_methods[] = {
 	{ }
 };
 
-static GDBusSignalTable server_signals[] = {
+static const GDBusSignalTable server_signals[] = {
 	{ "PropertyChanged", "s[name]v[value]"},
 	{ }
 };
diff --git a/serial/proxy.c b/serial/proxy.c
index d6cfa2d..7f23da3 100644
--- a/serial/proxy.c
+++ b/serial/proxy.c
@@ -1118,7 +1118,7 @@ static const GDBusMethodTable manager_methods[] = {
 	{ },
 };
 
-static GDBusSignalTable manager_signals[] = {
+static const GDBusSignalTable manager_signals[] = {
 	{ "ProxyCreated", "s[path]" },
 	{ "ProxyRemoved", "s[path]" },
 	{ }
diff --git a/src/adapter.c b/src/adapter.c
index 16a11c5..772c926 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -1685,7 +1685,7 @@ static const GDBusMethodTable adapter_methods[] = {
 	{ }
 };
 
-static GDBusSignalTable adapter_signals[] = {
+static const GDBusSignalTable adapter_signals[] = {
 	{ "PropertyChanged",		"s[name]v[value]"		},
 	{ "DeviceCreated",		"o[device]"			},
 	{ "DeviceRemoved",		"o[device]"			},
diff --git a/src/device.c b/src/device.c
index e2a83f7..567ece1 100644
--- a/src/device.c
+++ b/src/device.c
@@ -888,7 +888,7 @@ static const GDBusMethodTable device_methods[] = {
 	{ }
 };
 
-static GDBusSignalTable device_signals[] = {
+static const GDBusSignalTable device_signals[] = {
 	{ "PropertyChanged",		"s[name]v[value]" },
 	{ "DisconnectRequested",	""	},
 	{ }
diff --git a/src/manager.c b/src/manager.c
index ef9150c..f43861d 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -205,7 +205,7 @@ static const GDBusMethodTable manager_methods[] = {
 	{ }
 };
 
-static GDBusSignalTable manager_signals[] = {
+static const GDBusSignalTable manager_signals[] = {
 	{ "PropertyChanged",		"s[name]v[value]"	},
 	{ "AdapterAdded",		"o[adapter]"		},
 	{ "AdapterRemoved",		"o[adapter]"		},
diff --git a/thermometer/thermometer.c b/thermometer/thermometer.c
index 674150d..487c1fc 100644
--- a/thermometer/thermometer.c
+++ b/thermometer/thermometer.c
@@ -970,7 +970,7 @@ static const GDBusMethodTable thermometer_methods[] = {
 	{ }
 };
 
-static GDBusSignalTable thermometer_signals[] = {
+static const GDBusSignalTable thermometer_signals[] = {
 	{ "PropertyChanged",	"s[name]v[value]" },
 	{ }
 };
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [BlueZ v3 00/10] gdbus: Better D-Bus introspection
  2012-04-27 21:14 [BlueZ v3 00/10] gdbus: Better D-Bus introspection Lucas De Marchi
                   ` (9 preceding siblings ...)
  2012-04-27 21:14 ` [BlueZ v3 10/10] Constify GDBus signal tables Lucas De Marchi
@ 2012-04-29 11:52 ` Luiz Augusto von Dentz
  2012-04-29 21:40   ` Lucas De Marchi
  10 siblings, 1 reply; 15+ messages in thread
From: Luiz Augusto von Dentz @ 2012-04-29 11:52 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: linux-bluetooth

Hi Lucas,

On Sat, Apr 28, 2012 at 12:14 AM, Lucas De Marchi
<lucas.demarchi@profusion.mobi> wrote:
> This series improves D-Bus introspection in gdbus to ease the life of people
> using our interface: they can rely on binding generator available for QT, GTK
> and others.
>
> We are doing basically 3 things:
>
>  - Adding the name of the arguments in methods and signals
>  - Adding some annotations:
>        - deprecated
>        - no-reply
>  - Constifying the tables
>

My only problem with those patches is the use of '[' ']' as
delimiters, we have first to agree with D-Bus people if this can be
made reserved as other binding did with their internal delimiters:

(reserved)	109 (ASCII 'm')	Reserved for a 'maybe' type compatible with
the one in GVariant, and must not appear in signatures used on D-Bus
until specified here
(reserved)	42 (ASCII '*')	Reserved for use in bindings/implementations
to represent any single complete type, and must not appear in
signatures used on D-Bus.
(reserved)	63 (ASCII '?')	Reserved for use in bindings/implementations
to represent any basic type, and must not appear in signatures used on
D-Bus.
(reserved)	64 (ASCII '@'), 38 (ASCII '&'), 94 (ASCII '^')	Reserved for
internal use by bindings/implementations, and must not appear in
signatures used on D-Bus. GVariant uses these type-codes to encode
calling conventions.

Or we use one of those above.

-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [BlueZ v3 00/10] gdbus: Better D-Bus introspection
  2012-04-29 11:52 ` [BlueZ v3 00/10] gdbus: Better D-Bus introspection Luiz Augusto von Dentz
@ 2012-04-29 21:40   ` Lucas De Marchi
  2012-04-30 10:34     ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 15+ messages in thread
From: Lucas De Marchi @ 2012-04-29 21:40 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

On Sun, Apr 29, 2012 at 8:52 AM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> Hi Lucas,
>
> On Sat, Apr 28, 2012 at 12:14 AM, Lucas De Marchi
> <lucas.demarchi@profusion.mobi> wrote:
>> This series improves D-Bus introspection in gdbus to ease the life of people
>> using our interface: they can rely on binding generator available for QT, GTK
>> and others.
>>
>> We are doing basically 3 things:
>>
>>  - Adding the name of the arguments in methods and signals
>>  - Adding some annotations:
>>        - deprecated
>>        - no-reply
>>  - Constifying the tables
>>
>
> My only problem with those patches is the use of '[' ']' as
> delimiters, we have first to agree with D-Bus people if this can be
> made reserved as other binding did with their internal delimiters:
>
> (reserved)      109 (ASCII 'm') Reserved for a 'maybe' type compatible with
> the one in GVariant, and must not appear in signatures used on D-Bus
> until specified here
> (reserved)      42 (ASCII '*')  Reserved for use in bindings/implementations
> to represent any single complete type, and must not appear in
> signatures used on D-Bus.
> (reserved)      63 (ASCII '?')  Reserved for use in bindings/implementations
> to represent any basic type, and must not appear in signatures used on
> D-Bus.
> (reserved)      64 (ASCII '@'), 38 (ASCII '&'), 94 (ASCII '^')  Reserved for
> internal use by bindings/implementations, and must not appear in
> signatures used on D-Bus. GVariant uses these type-codes to encode
> calling conventions.
>
> Or we use one of those above.

Since we are using '[' and ']' only internally. I don't see a problem
with that. If D-Bus start using it we can change later. Of course it's
better to convince D-Bus guys to reserve that, but IMO this shouldn't
be a blocker.

>From the chars you suggested, only '@' seems reasonable and I can
change to this char if we agree on it.

Lucas De Marchi

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [BlueZ v3 00/10] gdbus: Better D-Bus introspection
  2012-04-29 21:40   ` Lucas De Marchi
@ 2012-04-30 10:34     ` Luiz Augusto von Dentz
  2012-04-30 13:37       ` Lucas De Marchi
  0 siblings, 1 reply; 15+ messages in thread
From: Luiz Augusto von Dentz @ 2012-04-30 10:34 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: linux-bluetooth

Hi Lucas,

On Mon, Apr 30, 2012 at 12:40 AM, Lucas De Marchi
<lucas.demarchi@profusion.mobi> wrote:
>
> Since we are using '[' and ']' only internally. I don't see a problem
> with that. If D-Bus start using it we can change later. Of course it's
> better to convince D-Bus guys to reserve that, but IMO this shouldn't
> be a blocker.
>
> From the chars you suggested, only '@' seems reasonable and I can
> change to this char if we agree on it.

 Either way IMO it is ugly to mess around with the signature but
perhaps it is the only alternative we have.

I wonder how other binding works in this regard, or they always have
to depend on a xml file that describes the interface? iirc that used
to be the case for GTK and QT, perhaps python is the only one that can
really make use of this in runtime as d-feet seems to be able to use
this information already.

-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [BlueZ v3 00/10] gdbus: Better D-Bus introspection
  2012-04-30 10:34     ` Luiz Augusto von Dentz
@ 2012-04-30 13:37       ` Lucas De Marchi
  0 siblings, 0 replies; 15+ messages in thread
From: Lucas De Marchi @ 2012-04-30 13:37 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

On Mon, Apr 30, 2012 at 7:34 AM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> Hi Lucas,
>
> On Mon, Apr 30, 2012 at 12:40 AM, Lucas De Marchi
> <lucas.demarchi@profusion.mobi> wrote:
>>
>> Since we are using '[' and ']' only internally. I don't see a problem
>> with that. If D-Bus start using it we can change later. Of course it's
>> better to convince D-Bus guys to reserve that, but IMO this shouldn't
>> be a blocker.
>>
>> From the chars you suggested, only '@' seems reasonable and I can
>> change to this char if we agree on it.
>
>  Either way IMO it is ugly to mess around with the signature but
> perhaps it is the only alternative we have.

There are other ways, but they have shortcomings, too -> the other 2
approaches that I sent to this ML have the shortcoming that in C it's
not possible to initialize flexible array members in a nested context.


>
> I wonder how other binding works in this regard, or they always have
> to depend on a xml file that describes the interface? iirc that used
> to be the case for GTK and QT, perhaps python is the only one that can
> really make use of this in runtime as d-feet seems to be able to use
> this information already.

As far as I checked, what glib does is to maintain the arguments in a
separate array (http://developer.gnome.org/gio/stable/gio-D-Bus-Introspection-Data.html#GDBusMethodInfo-struct).
This implies that for each method we need to declare the arguments in
a separate structure, not nested as we are doing now.


Lucas De Marchi

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-04-30 13:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-27 21:14 [BlueZ v3 00/10] gdbus: Better D-Bus introspection Lucas De Marchi
2012-04-27 21:14 ` [BlueZ v3 01/10] gdbus: return if method signature is malformed Lucas De Marchi
2012-04-27 21:14 ` [BlueZ v3 02/10] gdbus: do not call memset for terminating NUL Lucas De Marchi
2012-04-27 21:14 ` [BlueZ v3 03/10] gdbus: save copy of undecorated signature Lucas De Marchi
2012-04-27 21:14 ` [BlueZ v3 04/10] gdbus: use argument name in method introspection Lucas De Marchi
2012-04-27 21:14 ` [BlueZ v3 05/10] gdbus: add decorated signature to arguments Lucas De Marchi
2012-04-27 21:14 ` [BlueZ v3 06/10] gdbus: add decorated signature to return values Lucas De Marchi
2012-04-27 21:14 ` [BlueZ v3 07/10] gdbus: add Deprecated annotation to introspection Lucas De Marchi
2012-04-27 21:14 ` [BlueZ v3 08/10] gdbus: add Method.NoReply " Lucas De Marchi
2012-04-27 21:14 ` [BlueZ v3 09/10] Constify GDBus method tables Lucas De Marchi
2012-04-27 21:14 ` [BlueZ v3 10/10] Constify GDBus signal tables Lucas De Marchi
2012-04-29 11:52 ` [BlueZ v3 00/10] gdbus: Better D-Bus introspection Luiz Augusto von Dentz
2012-04-29 21:40   ` Lucas De Marchi
2012-04-30 10:34     ` Luiz Augusto von Dentz
2012-04-30 13:37       ` Lucas De Marchi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.