aboutsummaryrefslogtreecommitdiffstats
path: root/sap
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 /sap
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 'sap')
-rw-r--r--sap/sap-dummy.c15
-rw-r--r--sap/server.c9
2 files changed, 17 insertions, 7 deletions
diff --git a/sap/sap-dummy.c b/sap/sap-dummy.c
index a2f29686..b2739186 100644
--- a/sap/sap-dummy.c
+++ b/sap/sap-dummy.c
@@ -316,10 +316,17 @@ static DBusMessage *card_status(DBusConnection *conn, DBusMessage *msg,
}
static const GDBusMethodTable dummy_methods[] = {
- { "OngoingCall", "b", "", ongoing_call},
- { "MaxMessageSize", "u", "", max_msg_size},
- { "DisconnectImmediate", "", "", disconnect_immediate},
- { "CardStatus", "u", "", card_status},
+ { _GDBUS_METHOD("OngoingCall", "b", "",
+ GDBUS_ARGS({ "ongoing", "b" }), NULL,
+ ongoing_call) },
+ { _GDBUS_METHOD("MaxMessageSize", "u", "",
+ GDBUS_ARGS({ "size", "u" }), NULL,
+ max_msg_size) },
+ { _GDBUS_METHOD("DisconnectImmediate", "", "", NULL, NULL,
+ disconnect_immediate) },
+ { _GDBUS_METHOD("CardStatus", "u", "",
+ GDBUS_ARGS({ "status", "" }), NULL,
+ card_status) },
{ }
};
diff --git a/sap/server.c b/sap/server.c
index b212ea04..342cd645 100644
--- a/sap/server.c
+++ b/sap/server.c
@@ -1304,13 +1304,16 @@ static DBusMessage *get_properties(DBusConnection *c,
}
static const GDBusMethodTable server_methods[] = {
- {"GetProperties", "", "a{sv}", get_properties},
- {"Disconnect", "", "", disconnect},
+ { _GDBUS_METHOD("GetProperties", "", "a{sv}",
+ NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
+ get_properties) },
+ { _GDBUS_METHOD("Disconnect", "", "", NULL, NULL, disconnect) },
{ }
};
static const GDBusSignalTable server_signals[] = {
- { "PropertyChanged", "sv"},
+ { _GDBUS_SIGNAL("PropertyChanged", "sv",
+ GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
{ }
};