aboutsummaryrefslogtreecommitdiffstats
path: root/attrib/client.c
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2012-05-18 00:23:29 -0300
committerMarcel Holtmann <marcel@holtmann.org>2012-05-17 20:32:20 -0700
commitaa3b9016bf444b60e1b7e1804dfc323a23a93c5a (patch)
tree67cc00db85ab80f56dcf0b66ffed204943723b9f /attrib/client.c
parent2e576dd2f9ec1aa8e06b648707a746945b335fc7 (diff)
downloadbluez-aa3b9016bf444b60e1b7e1804dfc323a23a93c5a.tar.gz
bluez-aa3b9016bf444b60e1b7e1804dfc323a23a93c5a.tar.xz
bluez-aa3b9016bf444b60e1b7e1804dfc323a23a93c5a.zip
Convert GDBus methods to use macro helpers
With these macro helpers we can separate in/out arguments and use their own vector.
Diffstat (limited to 'attrib/client.c')
-rw-r--r--attrib/client.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/attrib/client.c b/attrib/client.c
index 2179f63b..df1496f8 100644
--- a/attrib/client.c
+++ b/attrib/client.c
@@ -516,9 +516,12 @@ static DBusMessage *set_property(DBusConnection *conn,
}
static const GDBusMethodTable char_methods[] = {
- { "GetProperties", "", "a{sv}", get_properties },
- { "SetProperty", "sv", "", set_property,
- G_DBUS_METHOD_FLAG_ASYNC},
+ { _GDBUS_METHOD("GetProperties", "", "a{sv}",
+ NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
+ get_properties) },
+ { _GDBUS_METHOD("SetProperty", "sv", "",
+ GDBUS_ARGS({ "name", "s" }, { "value", "v" }), NULL,
+ set_property) },
{ }
};
@@ -1016,13 +1019,18 @@ static DBusMessage *prim_get_properties(DBusConnection *conn, DBusMessage *msg,
}
static const GDBusMethodTable prim_methods[] = {
- { "DiscoverCharacteristics", "", "ao", discover_char,
- G_DBUS_METHOD_FLAG_ASYNC },
- { "RegisterCharacteristicsWatcher", "o", "",
- register_watcher },
- { "UnregisterCharacteristicsWatcher", "o", "",
- unregister_watcher },
- { "GetProperties", "", "a{sv}",prim_get_properties },
+ { _GDBUS_ASYNC_METHOD("DiscoverCharacteristics", "", "ao",
+ NULL, GDBUS_ARGS({ "characteristics", "ao" }),
+ discover_char) },
+ { _GDBUS_METHOD("RegisterCharacteristicsWatcher", "o", "",
+ GDBUS_ARGS({ "agent", "o" }), NULL,
+ register_watcher) },
+ { _GDBUS_METHOD("UnregisterCharacteristicsWatcher", "o", "",
+ GDBUS_ARGS({ "agent", "o" }), NULL,
+ unregister_watcher) },
+ { _GDBUS_METHOD("GetProperties", "", "a{sv}",
+ NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
+ prim_get_properties) },
{ }
};