summaryrefslogtreecommitdiff
path: root/src/manager.c
diff options
context:
space:
mode:
authorHenrique Dante de Almeida <hdante@profusion.mobi>2012-05-18 17:30:06 -0300
committerMarcel Holtmann <marcel@holtmann.org>2012-05-18 15:02:37 -0700
commit0bb3ef14d109f12fbb629e623b5c460915425e70 (patch)
tree643d29bb545ccbf4fb32aa436443c8977d54a74f /src/manager.c
parent77a4d3fa07101334b45c1e8d84b327effc2ff910 (diff)
downloadconnman-0bb3ef14d109f12fbb629e623b5c460915425e70.tar.gz
connman-0bb3ef14d109f12fbb629e623b5c460915425e70.tar.bz2
connman-0bb3ef14d109f12fbb629e623b5c460915425e70.zip
Convert GDBus methods and signals to use macro helpers
With these macro helpers we can separate in/out arguments and use their own vector.
Diffstat (limited to 'src/manager.c')
-rw-r--r--src/manager.c81
1 files changed, 58 insertions, 23 deletions
diff --git a/src/manager.c b/src/manager.c
index b4481859..33b50e2a 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -394,33 +394,68 @@ static DBusMessage *release_private_network(DBusConnection *conn,
}
static const GDBusMethodTable manager_methods[] = {
- { "GetProperties", "", "a{sv}", get_properties },
- { "SetProperty", "sv", "", set_property,
- G_DBUS_METHOD_FLAG_ASYNC },
- { "GetTechnologies", "", "a(oa{sv})", get_technologies },
- { "RemoveProvider", "o", "", remove_provider },
- { "GetServices", "", "a(oa{sv})", get_services },
- { "ConnectProvider", "a{sv}", "o", connect_provider,
- G_DBUS_METHOD_FLAG_ASYNC },
- { "RegisterAgent", "o", "", register_agent },
- { "UnregisterAgent", "o", "", unregister_agent },
- { "RegisterCounter", "ouu", "", register_counter },
- { "UnregisterCounter", "o", "", unregister_counter },
- { "CreateSession", "a{sv}o", "o", create_session },
- { "DestroySession", "o", "", destroy_session },
- { "RequestPrivateNetwork", "", "oa{sv}h",
- request_private_network,
- G_DBUS_METHOD_FLAG_ASYNC },
- { "ReleasePrivateNetwork", "o", "",
- release_private_network },
+ { _GDBUS_METHOD("GetProperties", "", "a{sv}",
+ NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
+ get_properties) },
+ { _GDBUS_ASYNC_METHOD("SetProperty", "sv", "",
+ GDBUS_ARGS({ "properties", "a{sv}" }), NULL,
+ set_property) },
+ { _GDBUS_METHOD("GetTechnologies", "", "a(oa{sv})",
+ NULL, GDBUS_ARGS({ "technologies", "a(oa{sv})" }),
+ get_technologies) },
+ { _GDBUS_METHOD("RemoveProvider", "o", "",
+ GDBUS_ARGS({ "provider", "o" }), NULL,
+ remove_provider) },
+ { _GDBUS_METHOD("GetServices", "", "a(oa{sv})",
+ NULL, GDBUS_ARGS({ "services", "a(oa{sv})" }),
+ get_services) },
+ { _GDBUS_ASYNC_METHOD("ConnectProvider", "a{sv}", "o",
+ GDBUS_ARGS({ "provider", "a{sv}" }),
+ GDBUS_ARGS({ "path", "o" }),
+ connect_provider) },
+ { _GDBUS_METHOD("RegisterAgent", "o", "",
+ GDBUS_ARGS({ "path", "o" }), NULL,
+ register_agent) },
+ { _GDBUS_METHOD("UnregisterAgent", "o", "",
+ GDBUS_ARGS({ "path", "o" }), NULL,
+ unregister_agent) },
+ { _GDBUS_METHOD("RegisterCounter", "ouu", "",
+ GDBUS_ARGS({ "path", "o" }, { "accuracy", "u" },
+ { "period", "u" }),
+ NULL, register_counter) },
+ { _GDBUS_METHOD("UnregisterCounter", "o", "",
+ GDBUS_ARGS({ "path", "o" }), NULL,
+ unregister_counter) },
+ { _GDBUS_METHOD("CreateSession", "a{sv}o", "o",
+ GDBUS_ARGS({ "settings", "a{sv}" },
+ { "notifier", "o" }),
+ GDBUS_ARGS({ "session", "o" }),
+ create_session) },
+ { _GDBUS_METHOD("DestroySession", "o", "",
+ GDBUS_ARGS({ "session", "o" }), NULL,
+ destroy_session) },
+ { _GDBUS_ASYNC_METHOD("RequestPrivateNetwork", "", "oa{sv}h",
+ NULL, GDBUS_ARGS({ "path", "o" },
+ { "settings", "a{sv}" },
+ { "socket", "h" }),
+ request_private_network) },
+ { _GDBUS_METHOD("ReleasePrivateNetwork", "o", "",
+ GDBUS_ARGS({ "path", "o" }), NULL,
+ release_private_network) },
{ },
};
static const GDBusSignalTable manager_signals[] = {
- { "PropertyChanged", "sv" },
- { "TechnologyAdded", "oa{sv}" },
- { "TechnologyRemoved", "o" },
- { "ServicesChanged", "a(oa{sv})ao" },
+ { _GDBUS_SIGNAL("PropertyChanged", "sv",
+ GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
+ { _GDBUS_SIGNAL("TechnologyAdded", "oa{sv}",
+ GDBUS_ARGS({ "path", "o" },
+ { "properties", "a{sv}" })) },
+ { _GDBUS_SIGNAL("TechnologyRemoved", "o",
+ GDBUS_ARGS({ "path", "o" })) },
+ { _GDBUS_SIGNAL("ServicesChanged", "a(oa{sv})ao",
+ GDBUS_ARGS({ "services_changed", "a(oa{sv})" },
+ { "services_removed", "ao" })) },
{ },
};