From: Anderson Briglia <anderson.briglia@xxxxxxxxxxxxx> Implements display status signal watcher in maemo6 plugin. --- plugins/maemo6.c | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/plugins/maemo6.c b/plugins/maemo6.c index 56f2664..0247f20 100644 --- a/plugins/maemo6.c +++ b/plugins/maemo6.c @@ -46,12 +46,35 @@ #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 collision = FALSE; +static void mce_tklock_mode_cb(DBusConnection *connection, + DBusMessage *message, void *user_data) +{ + DBusMessageIter args; + const char *sigvalue; + struct btd_adapter *adapter = user_data; + + if (!dbus_message_iter_init(message, &args)) { + error("message has no arguments"); + return; + } + + if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING) { + error("argument is not string"); + return; + } + + dbus_message_iter_get_basic(&args, &sigvalue); + DBG("got signal with value %s", sigvalue); +} + static gboolean mce_signal_callback(DBusConnection *connection, DBusMessage *message, void *user_data) { @@ -204,6 +227,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 +243,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 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html