Linux bluetooth development
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 5/5] core: Fix emitting changes to properties on power off
Date: Mon, 17 Dec 2012 17:45:55 +0200	[thread overview]
Message-ID: <1355759155-27921-5-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1355759155-27921-1-git-send-email-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

Discoverable and pairable are independent to the powered state so they
should not be changed just because the controller power state is set to
off.
---
 src/adapter.c | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index b15c8b7..5fe3010 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -1688,7 +1688,6 @@ static void unload_drivers(struct btd_adapter *adapter)
 int btd_adapter_stop(struct btd_adapter *adapter)
 {
 	DBusConnection *conn = btd_get_dbus_connection();
-	bool emit_discoverable = false, emit_pairable = false;
 	bool emit_discovering = false;
 
 	/* check pending requests */
@@ -1711,24 +1710,10 @@ int btd_adapter_stop(struct btd_adapter *adapter)
 		adapter_remove_connection(adapter, device);
 	}
 
-	if (adapter->discoverable)
-		emit_discoverable = true;
-
-	if (adapter->connectable && adapter->pairable == TRUE)
-		emit_pairable = true;
-
-	adapter->discoverable = FALSE;
 	adapter->connectable = false;
 
 	adapter->off_requested = FALSE;
 
-	if (emit_discoverable)
-		g_dbus_emit_property_changed(conn, adapter->path,
-					ADAPTER_INTERFACE, "Discoverable");
-	if (emit_pairable)
-		g_dbus_emit_property_changed(conn, adapter->path,
-					ADAPTER_INTERFACE, "Pairable");
-
 	if (emit_discovering)
 		g_dbus_emit_property_changed(conn, adapter->path,
 					ADAPTER_INTERFACE, "Discovering");
-- 
1.7.11.7


  parent reply	other threads:[~2012-12-17 15:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-17 15:45 [PATCH BlueZ 1/5] core: Fix set_pairable to not attempt to power on the adapter Luiz Augusto von Dentz
2012-12-17 15:45 ` [PATCH BlueZ 2/5] core: Fix set_discoverable " Luiz Augusto von Dentz
2012-12-17 15:45 ` [PATCH BlueZ 3/5] core: Simplify set_powered to not use set_mode Luiz Augusto von Dentz
2012-12-17 15:55   ` Anderson Lizardo
2012-12-17 18:30     ` Johan Hedberg
2012-12-17 15:45 ` [PATCH BlueZ 4/5] core: Remove mode session code Luiz Augusto von Dentz
2012-12-17 15:45 ` Luiz Augusto von Dentz [this message]
2012-12-17 15:51 ` [PATCH BlueZ 1/5] core: Fix set_pairable to not attempt to power on the adapter 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=1355759155-27921-5-git-send-email-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --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