summaryrefslogtreecommitdiffstats
path: root/serial
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-08-10 19:55:44 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-08-10 19:55:44 +0000
commitef00bdddbc2a37b1e0b8d0b4ad8430352d45c21b (patch)
tree4674a2179e0e357fdfcd736622ae95d233adc466 /serial
parent71d64082d40bcf1ce620fd3303494667ae1e4771 (diff)
serial: ListProxies implementation
Diffstat (limited to 'serial')
-rw-r--r--serial/manager.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/serial/manager.c b/serial/manager.c
index bdad9b32..913ea540 100644
--- a/serial/manager.c
+++ b/serial/manager.c
@@ -1072,7 +1072,28 @@ static DBusHandlerResult create_proxy(DBusConnection *conn,
static DBusHandlerResult list_proxies(DBusConnection *conn,
DBusMessage *msg, void *data)
{
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ DBusMessageIter iter, iter_array;
+ DBusMessage *reply;
+ GSList *l;
+ const char *path;
+
+ reply = dbus_message_new_method_return(msg);
+ if (!reply)
+ return DBUS_HANDLER_RESULT_NEED_MEMORY;
+
+ dbus_message_iter_init_append(reply, &iter);
+ dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
+ DBUS_TYPE_STRING_AS_STRING, &iter_array);
+
+ for (l = proxies_paths; l; l = l->next) {
+ path = l->data;
+ dbus_message_iter_append_basic(&iter_array,
+ DBUS_TYPE_STRING, &path);
+ }
+
+ dbus_message_iter_close_container(&iter, &iter_array);
+
+ return send_message_and_unref(conn, reply);
}
static DBusHandlerResult remove_proxy(DBusConnection *conn,