summaryrefslogtreecommitdiff
path: root/src/manager.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-11-25 16:54:47 +0100
committerMarcel Holtmann <marcel@holtmann.org>2009-11-25 16:54:47 +0100
commit8d304343818090c3ae76b8c812e101aca3ca262d (patch)
treec7a7da6d26fcf65e1f212cee15f315391e5a2d51 /src/manager.c
parent4ca114eed5a1b092fb0e585de877a9db6281bb62 (diff)
downloadconnman-8d304343818090c3ae76b8c812e101aca3ca262d.tar.gz
connman-8d304343818090c3ae76b8c812e101aca3ca262d.tar.bz2
connman-8d304343818090c3ae76b8c812e101aca3ca262d.zip
Add support for dynamic debug framework
Diffstat (limited to 'src/manager.c')
-rw-r--r--src/manager.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/manager.c b/src/manager.c
index e761ce8c..1a114a41 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -195,6 +195,54 @@ static void append_connected_technologies(DBusMessageIter *dict)
dbus_message_iter_close_container(dict, &entry);
}
+static void append_available_debugs(DBusMessageIter *dict)
+{
+ DBusMessageIter entry, value, iter;
+ const char *key = "AvailableDebugs";
+
+ dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY,
+ NULL, &entry);
+
+ dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &key);
+
+ dbus_message_iter_open_container(&entry, DBUS_TYPE_VARIANT,
+ DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_STRING_AS_STRING,
+ &value);
+
+ dbus_message_iter_open_container(&value, DBUS_TYPE_ARRAY,
+ DBUS_TYPE_STRING_AS_STRING, &iter);
+ __connman_debug_list_available(&iter);
+ dbus_message_iter_close_container(&value, &iter);
+
+ dbus_message_iter_close_container(&entry, &value);
+
+ dbus_message_iter_close_container(dict, &entry);
+}
+
+static void append_enabled_debugs(DBusMessageIter *dict)
+{
+ DBusMessageIter entry, value, iter;
+ const char *key = "EnabledDebugs";
+
+ dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY,
+ NULL, &entry);
+
+ dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &key);
+
+ dbus_message_iter_open_container(&entry, DBUS_TYPE_VARIANT,
+ DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_STRING_AS_STRING,
+ &value);
+
+ dbus_message_iter_open_container(&value, DBUS_TYPE_ARRAY,
+ DBUS_TYPE_STRING_AS_STRING, &iter);
+ __connman_debug_list_enabled(&iter);
+ dbus_message_iter_close_container(&value, &iter);
+
+ dbus_message_iter_close_container(&entry, &value);
+
+ dbus_message_iter_close_container(dict, &entry);
+}
+
static DBusMessage *get_properties(DBusConnection *conn,
DBusMessage *msg, void *data)
{
@@ -252,6 +300,9 @@ static DBusMessage *get_properties(DBusConnection *conn,
connman_dbus_dict_append_variant(&dict, "DefaultTechnology",
DBUS_TYPE_STRING, &str);
+ append_available_debugs(&dict);
+ append_enabled_debugs(&dict);
+
dbus_message_iter_close_container(&array, &dict);
return reply;