From 47225048709183a2e54fa3fea0e29b91db1ea537 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 13 May 2009 21:00:13 -0700 Subject: [PATCH] Add callback skeleton for generic service connect method --- src/manager.c | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/src/manager.c b/src/manager.c index 6c079ff..f5c50f6 100644 --- a/src/manager.c +++ b/src/manager.c @@ -294,6 +294,39 @@ static DBusMessage *remove_profile(DBusConnection *conn, return __connman_error_not_supported(msg); } +static DBusMessage *connect_service(DBusConnection *conn, + DBusMessage *msg, void *data) +{ + DBusMessageIter iter, array; + + DBG("conn %p", conn); + + if (__connman_security_check_privilege(msg, + CONNMAN_SECURITY_PRIVILEGE_MODIFY) < 0) + return __connman_error_permission_denied(msg); + + dbus_message_iter_init(msg, &iter); + dbus_message_iter_recurse(&iter, &array); + + while (dbus_message_iter_get_arg_type(&array) == DBUS_TYPE_DICT_ENTRY) { + DBusMessageIter entry, value; + const char *key; + + dbus_message_iter_recurse(&array, &entry); + dbus_message_iter_get_basic(&entry, &key); + + dbus_message_iter_next(&entry); + dbus_message_iter_recurse(&entry, &value); + + switch (dbus_message_iter_get_arg_type(&value)) { + } + + dbus_message_iter_next(&array); + } + + return __connman_error_not_implemented(msg); +} + static DBusMessage *register_agent(DBusConnection *conn, DBusMessage *msg, void *data) { @@ -343,12 +376,13 @@ static DBusMessage *unregister_agent(DBusConnection *conn, } static GDBusMethodTable manager_methods[] = { - { "GetProperties", "", "a{sv}", get_properties }, - { "SetProperty", "sv", "", set_property }, - { "AddProfile", "s", "o", add_profile }, - { "RemoveProfile", "o", "", remove_profile }, - { "RegisterAgent", "o", "", register_agent }, - { "UnregisterAgent", "o", "", unregister_agent }, + { "GetProperties", "", "a{sv}", get_properties }, + { "SetProperty", "sv", "", set_property }, + { "AddProfile", "s", "o", add_profile }, + { "RemoveProfile", "o", "", remove_profile }, + { "ConnectService", "a{sv}", "o", connect_service }, + { "RegisterAgent", "o", "", register_agent }, + { "UnregisterAgent", "o", "", unregister_agent }, { }, }; -- 2.7.4