linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/3] adapter: Fix unplugging adapter bug
@ 2012-12-06 23:41 Andre Guedes
  2012-12-06 23:41 ` [PATCH BlueZ 2/3] adapter: Don't store Discoverable value if DiscoverableTimeout is set Andre Guedes
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andre Guedes @ 2012-12-06 23:41 UTC (permalink / raw)
  To: linux-bluetooth

If we unplug an adapter in powered on state, once it is plugged
again, it doesn't go to powered on state as expected. This bug
happens because Powered info is stored when the adapter is
unplugged from the system.

This patch fixes this bug by only storing adapter info if mode
changing was requested by user application via D-Bus interface.
This patch basically reverts the changes in commit
985d8ac397a7c332c1badcb95430a167ec93e9e7 where the bug was
introduced.
---
 src/adapter.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index 0a0e6f0..25501c4 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2230,8 +2230,6 @@ static void set_mode_complete(struct btd_adapter *adapter)
 	struct session_req *pending;
 	int err;
 
-	store_adapter_info(adapter);
-
 	DBG("%s", mode2str(adapter->mode));
 
 	if (adapter->mode == MODE_OFF) {
@@ -2271,6 +2269,8 @@ static void set_mode_complete(struct btd_adapter *adapter)
 	if (err != 0)
 		error("unable to set mode: %s", mode2str(pending->mode));
 
+	store_adapter_info(adapter);
+
 	session_unref(pending);
 }
 
-- 
1.8.0.1


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

end of thread, other threads:[~2012-12-07  9:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-06 23:41 [PATCH BlueZ 1/3] adapter: Fix unplugging adapter bug Andre Guedes
2012-12-06 23:41 ` [PATCH BlueZ 2/3] adapter: Don't store Discoverable value if DiscoverableTimeout is set Andre Guedes
2012-12-06 23:41 ` [PATCH BlueZ 3/3] adapter: Discoverable storage Andre Guedes
2012-12-07  9:22 ` [PATCH BlueZ 1/3] adapter: Fix unplugging adapter bug Johan Hedberg

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).