summaryrefslogtreecommitdiff
path: root/src/manager.c
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2012-01-05 10:14:21 +0200
committerDaniel Wagner <daniel.wagner@bmw-carit.de>2012-01-05 11:11:08 +0100
commit472da28189443312faabb07bd26e2d8f3c1e9145 (patch)
treee47fdef5074c5f558aea326ae922339c195e7180 /src/manager.c
parentb4bd4ecb4de9a13f5094c5e3d07446ae9dfd9b79 (diff)
downloadconnman-472da28189443312faabb07bd26e2d8f3c1e9145.tar.gz
connman-472da28189443312faabb07bd26e2d8f3c1e9145.tar.bz2
connman-472da28189443312faabb07bd26e2d8f3c1e9145.zip
technology: Implement Manager API GetTechnologies method call
Diffstat (limited to 'src/manager.c')
-rw-r--r--src/manager.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/manager.c b/src/manager.c
index e821df3c..f2fffa9b 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -129,6 +129,37 @@ static DBusMessage *set_property(DBusConnection *conn,
return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
+static DBusMessage *get_technologies(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ DBusMessage *reply;
+ DBusMessageIter iter, array;
+
+ DBG("");
+
+ reply = dbus_message_new_method_return(msg);
+ if (reply == NULL)
+ return NULL;
+
+ dbus_message_iter_init_append(reply, &iter);
+
+ dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
+ DBUS_STRUCT_BEGIN_CHAR_AS_STRING
+ DBUS_TYPE_OBJECT_PATH_AS_STRING
+ DBUS_TYPE_ARRAY_AS_STRING
+ DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
+ DBUS_TYPE_STRING_AS_STRING
+ DBUS_TYPE_VARIANT_AS_STRING
+ DBUS_DICT_ENTRY_END_CHAR_AS_STRING
+ DBUS_STRUCT_END_CHAR_AS_STRING, &array);
+
+ __connman_technology_list_struct(&array);
+
+ dbus_message_iter_close_container(&iter, &array);
+
+ return reply;
+}
+
static DBusMessage *remove_provider(DBusConnection *conn,
DBusMessage *msg, void *data)
{
@@ -491,6 +522,7 @@ static 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 },
{ "RequestScan", "s", "", request_scan },
{ "EnableTechnology", "s", "", enable_technology,