linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] Add Debug property to Manager interface
@ 2010-06-05  7:25 Gustavo F. Padovan
  2010-06-05  7:25 ` [PATCH 2/5] Add SetProperty method and Debug read/write property Gustavo F. Padovan
  0 siblings, 1 reply; 5+ messages in thread
From: Gustavo F. Padovan @ 2010-06-05  7:25 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: gustavo

---
 src/log.c     |    5 +++++
 src/log.h     |    1 +
 src/manager.c |    4 ++++
 3 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/log.c b/src/log.c
index 1bc0a42..4043ee3 100644
--- a/src/log.c
+++ b/src/log.c
@@ -97,6 +97,11 @@ void __btd_toggle_debug()
 	debug_enabled = !debug_enabled;
 }
 
+int __btd_debug_enabled()
+{
+	return debug_enabled;
+}
+
 void __btd_log_init(const char *debug, int detach)
 {
 	int option = LOG_NDELAY | LOG_PID;
diff --git a/src/log.h b/src/log.h
index c9412c4..681e71d 100644
--- a/src/log.h
+++ b/src/log.h
@@ -30,6 +30,7 @@ void debug(const char *format, ...) __attribute__((format(printf, 1, 2)));
 void __btd_log_init(const char *debug, int detach);
 void __btd_log_cleanup(void);
 void __btd_toggle_debug();
+int __btd_debug_enabled();
 
 struct btd_debug_desc {
         const char *name;
diff --git a/src/manager.c b/src/manager.c
index cbbca1e..eab7e80 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -183,6 +183,7 @@ static DBusMessage *get_properties(DBusConnection *conn,
 	DBusMessageIter dict;
 	GSList *list;
 	char **array;
+	gboolean debug_value;
 	int i;
 
 	reply = dbus_message_new_method_return(msg);
@@ -208,6 +209,9 @@ static DBusMessage *get_properties(DBusConnection *conn,
 	dict_append_array(&dict, "Adapters", DBUS_TYPE_OBJECT_PATH, &array, i);
 	g_free(array);
 
+	debug_value = __btd_debug_enabled();
+	dict_append_entry(&dict, "Debug", DBUS_TYPE_BOOLEAN, &debug_value);
+
 	dbus_message_iter_close_container(&iter, &dict);
 
 	return reply;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-06-05  7:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-05  7:25 [PATCH 1/5] Add Debug property to Manager interface Gustavo F. Padovan
2010-06-05  7:25 ` [PATCH 2/5] Add SetProperty method and Debug read/write property Gustavo F. Padovan
2010-06-05  7:25   ` [PATCH 3/5] log: Add function to get/set debug_string Gustavo F. Padovan
2010-06-05  7:25     ` [PATCH 4/5] Add DebugString Property to Manager Gustavo F. Padovan
2010-06-05  7:25       ` [PATCH 5/5] Document the new Debug and DebugString property Gustavo F. Padovan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).