All of lore.kernel.org
 help / color / mirror / Atom feed
From: Claudio Takahasi <claudio.takahasi@openbossa.org>
To: linux-bluetooth@vger.kernel.org
Cc: Anderson Briglia <anderson.briglia@openbossa.org>
Subject: [PATCH BlueZ 07/11] Add display lock watcher on maemo6 plugin
Date: Mon, 26 Sep 2011 14:48:24 -0300	[thread overview]
Message-ID: <1317059308-20038-8-git-send-email-claudio.takahasi@openbossa.org> (raw)
In-Reply-To: <1317059308-20038-1-git-send-email-claudio.takahasi@openbossa.org>

From: Anderson Briglia <anderson.briglia@openbossa.org>

Implements display status signal watcher in maemo6 plugin.
---
 plugins/maemo6.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/plugins/maemo6.c b/plugins/maemo6.c
index 00fb3fa..e380acd 100644
--- a/plugins/maemo6.c
+++ b/plugins/maemo6.c
@@ -46,12 +46,33 @@
 #define MCE_RADIO_STATES_CHANGE_REQ	"req_radio_states_change"
 #define MCE_RADIO_STATES_GET		"get_radio_states"
 #define MCE_RADIO_STATES_SIG		"radio_states_ind"
+#define MCE_TKLOCK_MODE_SIG		"tklock_mode_ind"
 
 static guint watch_id;
+static guint tklock_watch_id;
 static DBusConnection *conn = NULL;
 static gboolean mce_bt_set = FALSE;
 static gboolean mce_bt_on = FALSE;
 
+static gboolean mce_tklock_mode_cb(DBusConnection *connection,
+					DBusMessage *message, void *user_data)
+{
+	DBusMessageIter args;
+	const char *sigvalue;
+
+	if (!dbus_message_iter_init(message, &args)) {
+		error("message has no arguments");
+	} else if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING) {
+		error("argument is not string");
+	} else {
+
+		dbus_message_iter_get_basic(&args, &sigvalue);
+		DBG("got signal with value %s", sigvalue);
+	}
+
+	return TRUE;
+}
+
 static gboolean mce_signal_callback(DBusConnection *connection,
 					DBusMessage *message, void *user_data)
 {
@@ -204,6 +225,10 @@ static int mce_probe(struct btd_adapter *adapter)
 					MCE_SIGNAL_IF, MCE_RADIO_STATES_SIG,
 					mce_signal_callback, adapter, NULL);
 
+	tklock_watch_id = g_dbus_add_signal_watch(conn, NULL, MCE_SIGNAL_PATH,
+					MCE_SIGNAL_IF, MCE_TKLOCK_MODE_SIG,
+					mce_tklock_mode_cb, adapter, NULL);
+
 	btd_adapter_register_powered_callback(adapter, adapter_powered);
 
 	return 0;
@@ -216,6 +241,9 @@ static void mce_remove(struct btd_adapter *adapter)
 	if (watch_id > 0)
 		g_dbus_remove_watch(conn, watch_id);
 
+	if (tklock_watch_id > 0)
+		g_dbus_remove_watch(conn, tklock_watch_id);
+
 	btd_adapter_unregister_powered_callback(adapter, adapter_powered);
 }
 
-- 
1.7.6.1


  parent reply	other threads:[~2011-09-26 17:48 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-26 17:48 [PATCH BlueZ 00/11] Re-connections triggered by platform event Claudio Takahasi
2011-09-26 17:48 ` [PATCH BlueZ 01/11] Remove timer to trigger connection attempts Claudio Takahasi
2011-10-04 18:30   ` [PATCH Bluez " Claudio Takahasi
2011-09-26 17:48 ` [PATCH BlueZ 02/11] Add set auto connect in device Claudio Takahasi
2011-10-04 18:30   ` [PATCH Bluez " Claudio Takahasi
2011-09-26 17:48 ` [PATCH BlueZ 03/11] Add continuous connection attempt Claudio Takahasi
2011-10-04 18:30   ` [PATCH Bluez " Claudio Takahasi
2011-09-26 17:48 ` [PATCH BlueZ 04/11] Add checking if profiles are requesting connection Claudio Takahasi
2011-10-04 18:31   ` [PATCH Bluez " Claudio Takahasi
2011-09-26 17:48 ` [PATCH BlueZ 05/11] Fix repeated connection attempt to the same remote Claudio Takahasi
2011-10-04 18:31   ` [PATCH Bluez " Claudio Takahasi
2011-09-26 17:48 ` [PATCH BlueZ 06/11] Disable automatic connections after 60 seconds Claudio Takahasi
2011-10-04 18:31   ` [PATCH Bluez " Claudio Takahasi
2011-09-26 17:48 ` Claudio Takahasi [this message]
2011-10-04 18:31   ` [PATCH Bluez 07/11] Add display lock watcher on maemo6 plugin Claudio Takahasi
2011-09-26 17:48 ` [PATCH BlueZ 08/11] Set auto connect from " Claudio Takahasi
2011-10-04 18:31   ` [PATCH Bluez " Claudio Takahasi
2011-09-26 17:48 ` [PATCH BlueZ 09/11] Add an interval between connection attempts Claudio Takahasi
2011-10-04 18:32   ` [PATCH Bluez " Claudio Takahasi
2011-09-26 17:48 ` [PATCH BlueZ 10/11] Enable re-connection if reason is Timeout Claudio Takahasi
2011-10-04 18:32   ` [PATCH Bluez " Claudio Takahasi
2011-09-26 17:48 ` [PATCH BlueZ 11/11] Add automatic connect timeout config option Claudio Takahasi
2011-10-04 18:32   ` [PATCH Bluez " Claudio Takahasi
2011-10-04 18:30 ` [PATCH Bluez 00/11] Re-connections triggered by platform event Claudio Takahasi
2011-10-05 15:05 ` [PATCH BlueZ " 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=1317059308-20038-8-git-send-email-claudio.takahasi@openbossa.org \
    --to=claudio.takahasi@openbossa.org \
    --cc=anderson.briglia@openbossa.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.