From: Daniel Wagner Date: Mon, 19 Dec 2011 08:46:59 +0000 (+0100) Subject: dundee: Manager append devices X-Git-Tag: 1.7~60 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b7001e09888dddeae7201b3de3e1ca7cd21059f6;p=platform%2Fupstream%2Fofono.git dundee: Manager append devices --- diff --git a/dundee/manager.c b/dundee/manager.c index 61fa25e..d7374d6 100644 --- a/dundee/manager.c +++ b/dundee/manager.c @@ -30,6 +30,26 @@ #include "dundee.h" +static void append_device(struct dundee_device *device, void *userdata) +{ + DBusMessageIter *array = userdata; + const char *path = __dundee_device_get_path(device); + DBusMessageIter entry, dict; + + dbus_message_iter_open_container(array, DBUS_TYPE_STRUCT, + NULL, &entry); + dbus_message_iter_append_basic(&entry, DBUS_TYPE_OBJECT_PATH, + &path); + dbus_message_iter_open_container(&entry, DBUS_TYPE_ARRAY, + OFONO_PROPERTIES_ARRAY_SIGNATURE, + &dict); + + __dundee_device_append_properties(device, &dict); + + dbus_message_iter_close_container(&entry, &dict); + dbus_message_iter_close_container(array, &entry); +} + static DBusMessage *manager_get_devices(DBusConnection *conn, DBusMessage *msg, void *data) { @@ -56,6 +76,8 @@ static DBusMessage *manager_get_devices(DBusConnection *conn, DBUS_STRUCT_END_CHAR_AS_STRING, &array); + __dundee_device_foreach(append_device, &array); + dbus_message_iter_close_container(&iter, &array); return reply;