linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gustavo F. Padovan" <gustavo@padovan.org>
To: linux-bluetooth@vger.kernel.org
Cc: gustavo@padovan.org
Subject: [PATCH 4/8] Add Debug property to Manager interface
Date: Tue,  8 Jun 2010 04:11:50 -0300	[thread overview]
Message-ID: <1275981114-18019-4-git-send-email-gustavo@padovan.org> (raw)
In-Reply-To: <1275981114-18019-3-git-send-email-gustavo@padovan.org>

---
 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 0afd739..5d1db48 100644
--- a/src/log.h
+++ b/src/log.h
@@ -28,6 +28,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();
 
 extern int debug_enabled;
 
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


  reply	other threads:[~2010-06-08  7:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-08  7:11 [PATCH 1/8] Remove ifndef barrier from log.h and btio.h Gustavo F. Padovan
2010-06-08  7:11 ` [PATCH 2/8] log: Remove vinfo function Gustavo F. Padovan
2010-06-08  7:11   ` [PATCH 3/8] Fix regression with debug via SIGUSR2 Gustavo F. Padovan
2010-06-08  7:11     ` Gustavo F. Padovan [this message]
2010-06-08  7:11       ` [PATCH 5/8] Add SetProperty method and Debug read/write property Gustavo F. Padovan
2010-06-08  7:11         ` [PATCH 6/8] log: Add function to get/set debug_string Gustavo F. Padovan
2010-06-08  7:11           ` [PATCH 7/8] Add DebugString Property to Manager Gustavo F. Padovan
2010-06-08  7:11             ` [PATCH 8/8] Document the new Debug and DebugString property Gustavo F. Padovan
2010-06-08  8:05     ` [PATCH 3/8] Fix regression with debug via SIGUSR2 Johan Hedberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1275981114-18019-4-git-send-email-gustavo@padovan.org \
    --to=gustavo@padovan.org \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).