diff options
author | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2012-05-18 00:23:29 -0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-05-17 20:32:20 -0700 |
commit | aa3b9016bf444b60e1b7e1804dfc323a23a93c5a (patch) | |
tree | 67cc00db85ab80f56dcf0b66ffed204943723b9f /plugins | |
parent | 2e576dd2f9ec1aa8e06b648707a746945b335fc7 (diff) | |
download | bluez-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 'plugins')
-rw-r--r-- | plugins/dbusoob.c | 17 | ||||
-rw-r--r-- | plugins/service.c | 21 |
2 files changed, 27 insertions, 11 deletions
diff --git a/plugins/dbusoob.c b/plugins/dbusoob.c index bcd05563..0d7a6ff3 100644 --- a/plugins/dbusoob.c +++ b/plugins/dbusoob.c @@ -176,11 +176,18 @@ static DBusMessage *remove_remote_data(DBusConnection *conn, DBusMessage *msg, } static const GDBusMethodTable oob_methods[] = { - {"AddRemoteData", "sayay", "", add_remote_data}, - {"RemoveRemoteData", "s", "", remove_remote_data}, - {"ReadLocalData", "", "ayay", read_local_data, - G_DBUS_METHOD_FLAG_ASYNC}, - {} + { _GDBUS_METHOD("AddRemoteData", "sayay", "", + GDBUS_ARGS({ "address", "s" }, { "hash", "ay" }, + { "randomizer", "ay" }), NULL, + add_remote_data) }, + { _GDBUS_METHOD("RemoveRemoteData", "s", "", + GDBUS_ARGS({ "address", "s" }), NULL, + remove_remote_data) }, + { _GDBUS_ASYNC_METHOD("ReadLocalData", "", "ayay", + NULL, GDBUS_ARGS({ "hash", "ay" }, + { "randomizer", "ay" }), + read_local_data) }, + { } }; static int oob_probe(struct btd_adapter *adapter) diff --git a/plugins/service.c b/plugins/service.c index 978e3710..d03ef46f 100644 --- a/plugins/service.c +++ b/plugins/service.c @@ -697,12 +697,21 @@ done: } static const GDBusMethodTable service_methods[] = { - { "AddRecord", "s", "u", add_service_record }, - { "UpdateRecord", "us", "", update_service_record }, - { "RemoveRecord", "u", "", remove_service_record }, - { "RequestAuthorization","su", "", request_authorization, - G_DBUS_METHOD_FLAG_ASYNC}, - { "CancelAuthorization", "", "", cancel_authorization }, + { _GDBUS_METHOD("AddRecord", "s", "u", + GDBUS_ARGS({ "record", "s" }), + GDBUS_ARGS({ "handle", "u" }), + add_service_record) }, + { _GDBUS_METHOD("UpdateRecord", "us", "", + GDBUS_ARGS({ "handle", "u" }, { "record", "s" }), NULL, + update_service_record) }, + { _GDBUS_METHOD("RemoveRecord", "u", "", + GDBUS_ARGS({ "handle", "u" }), NULL, + remove_service_record) }, + { _GDBUS_ASYNC_METHOD("RequestAuthorization","su", "", + GDBUS_ARGS({ "address", "s" }, { "handle", "u"}), NULL, + request_authorization) }, + { _GDBUS_METHOD("CancelAuthorization", "", "", + NULL, NULL, cancel_authorization) }, { } }; |