summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/nmcompat.c10
-rw-r--r--src/clock.c11
-rw-r--r--src/manager.c81
-rw-r--r--src/service.c35
-rw-r--r--src/session.c11
-rw-r--r--src/technology.c15
-rw-r--r--unit/session-api.c6
7 files changed, 116 insertions, 53 deletions
diff --git a/plugins/nmcompat.c b/plugins/nmcompat.c
index 6299c349..680cdf8f 100644
--- a/plugins/nmcompat.c
+++ b/plugins/nmcompat.c
@@ -221,13 +221,17 @@ static DBusMessage *property_get(DBusConnection *conn,
}
static const GDBusMethodTable methods[] = {
- { "Get", "ss", "v", property_get },
+ { _GDBUS_METHOD("Get", "ss", "v",
+ GDBUS_ARGS({ "interface", "s" }, { "key", "s" }),
+ GDBUS_ARGS({ "property", "v" }), property_get) },
{ },
};
static const GDBusSignalTable signals[] = {
- { "PropertiesChanged", "a{sv}" },
- { "StateChanged", "u" },
+ { _GDBUS_SIGNAL("PropertiesChanged", "a{sv}",
+ GDBUS_ARGS({ "properties", "a{sv}" })) },
+ { _GDBUS_SIGNAL("StateChanged", "u",
+ GDBUS_ARGS({ "state", "u" })) },
{ },
};
diff --git a/src/clock.c b/src/clock.c
index 41e431f1..5562e525 100644
--- a/src/clock.c
+++ b/src/clock.c
@@ -309,13 +309,18 @@ static DBusMessage *set_property(DBusConnection *conn,
}
static const GDBusMethodTable clock_methods[] = {
- { "GetProperties", "", "a{sv}", get_properties },
- { "SetProperty", "sv", "", set_property },
+ { _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) },
{ },
};
static const GDBusSignalTable clock_signals[] = {
- { "PropertyChanged", "sv" },
+ { _GDBUS_SIGNAL("PropertyChanged", "sv",
+ GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
{ },
};
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" })) },
{ },
};
diff --git a/src/service.c b/src/service.c
index 595a3779..84a1124a 100644
--- a/src/service.c
+++ b/src/service.c
@@ -3812,22 +3812,33 @@ static void service_schedule_removed(struct connman_service *service)
}
static const GDBusMethodTable service_methods[] = {
- { "GetProperties", "", "a{sv}", get_properties,
- G_DBUS_METHOD_FLAG_DEPRECATED },
- { "SetProperty", "sv", "", set_property },
- { "ClearProperty", "s", "", clear_property },
- { "Connect", "", "", connect_service,
- G_DBUS_METHOD_FLAG_ASYNC },
- { "Disconnect", "", "", disconnect_service },
- { "Remove", "", "", remove_service },
- { "MoveBefore", "o", "", move_before },
- { "MoveAfter", "o", "", move_after },
- { "ResetCounters", "", "", reset_counters },
+ { _GDBUS_DEPRECATED_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) },
+ { _GDBUS_METHOD("ClearProperty", "s", "",
+ GDBUS_ARGS({ "name", "s" }), NULL,
+ clear_property) },
+ { _GDBUS_ASYNC_METHOD("Connect", "", "", NULL, NULL,
+ connect_service) },
+ { _GDBUS_METHOD("Disconnect", "", "", NULL, NULL,
+ disconnect_service) },
+ { _GDBUS_METHOD("Remove", "", "", NULL, NULL, remove_service) },
+ { _GDBUS_METHOD("MoveBefore", "o", "",
+ GDBUS_ARGS({ "service", "o" }), NULL,
+ move_before) },
+ { _GDBUS_METHOD("MoveAfter", "o", "",
+ GDBUS_ARGS({ "service", "o" }), NULL,
+ move_after) },
+ { _GDBUS_METHOD("ResetCounters", "", "", NULL, NULL, reset_counters) },
{ },
};
static const GDBusSignalTable service_signals[] = {
- { "PropertyChanged", "sv" },
+ { _GDBUS_SIGNAL("PropertyChanged", "sv",
+ GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
{ },
};
diff --git a/src/session.c b/src/session.c
index 50f60618..c73db63c 100644
--- a/src/session.c
+++ b/src/session.c
@@ -1556,10 +1556,13 @@ static DBusMessage *destroy_session(DBusConnection *conn,
}
static const GDBusMethodTable session_methods[] = {
- { "Destroy", "", "", destroy_session },
- { "Connect", "", "", connect_session },
- { "Disconnect", "", "", disconnect_session },
- { "Change", "sv", "", change_session },
+ { _GDBUS_METHOD("Destroy", "", "", NULL, NULL, destroy_session) },
+ { _GDBUS_METHOD("Connect", "", "", NULL, NULL, connect_session) },
+ { _GDBUS_METHOD("Disconnect", "", "", NULL, NULL,
+ disconnect_session ) },
+ { _GDBUS_METHOD("Change", "sv", "",
+ GDBUS_ARGS({ "name", "s" }, { "value", "v" }),
+ NULL, change_session) },
{ },
};
diff --git a/src/technology.c b/src/technology.c
index 30a9f4d9..5cb6ddb8 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -859,16 +859,19 @@ static DBusMessage *scan(DBusConnection *conn, DBusMessage *msg, void *data)
}
static const GDBusMethodTable technology_methods[] = {
- { "GetProperties", "", "a{sv}", get_properties,
- G_DBUS_METHOD_FLAG_DEPRECATED },
- { "SetProperty", "sv", "", set_property },
- { "Scan", "", "", scan,
- G_DBUS_METHOD_FLAG_ASYNC },
+ { _GDBUS_DEPRECATED_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) },
+ { _GDBUS_ASYNC_METHOD("Scan", "", "", NULL, NULL, scan) },
{ },
};
static const GDBusSignalTable technology_signals[] = {
- { "PropertyChanged", "sv" },
+ { _GDBUS_SIGNAL("PropertyChanged", "sv",
+ GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
{ },
};
diff --git a/unit/session-api.c b/unit/session-api.c
index c5b7b6ce..27ca2c71 100644
--- a/unit/session-api.c
+++ b/unit/session-api.c
@@ -286,8 +286,10 @@ static DBusMessage *notify_update(DBusConnection *conn,
}
static const GDBusMethodTable notify_methods[] = {
- { "Release", "", "", notify_release },
- { "Update", "a{sv}", "", notify_update },
+ { _GDBUS_METHOD("Release", "", "", NULL, NULL, notify_release) },
+ { _GDBUS_METHOD("Update", "a{sv}", "",
+ GDBUS_ARGS({ "settings", "a{sv}" }), NULL,
+ notify_update) },
{ },
};