All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Write discoverable mode on storage after HCI response
@ 2012-08-08 13:03 chanyeol.park
  2012-08-20 11:25 ` Chan-yeol Park
  0 siblings, 1 reply; 5+ messages in thread
From: chanyeol.park @ 2012-08-08 13:03 UTC (permalink / raw)
  To: linux-bluetooth

From: Chan-yeol Park <chanyeol.park@samsung.com>

Right after HCI mode command is sent, Bluez writes mode value
on the storage. but in case of DiscoverableTimeout, storage value
is not updated like adapter->mode value. So this logic is moved.
---
 src/adapter.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index acb845e..1b8e3b0 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -302,7 +302,6 @@ static int set_mode(struct btd_adapter *adapter, uint8_t new_mode,
 
 done:
 	modestr = mode2str(new_mode);
-	write_device_mode(&adapter->bdaddr, modestr);
 
 	DBG("%s", modestr);
 
@@ -2244,6 +2243,12 @@ static void set_mode_complete(struct btd_adapter *adapter)
 		adapter->mode_sessions = NULL;
 	}
 
+	modestr = mode2str(adapter->mode);
+
+	DBG("%s", modestr);
+
+	write_device_mode(&adapter->bdaddr, modestr);
+
 	if (adapter->pending_mode == NULL)
 		return;
 
@@ -2268,10 +2273,6 @@ static void set_mode_complete(struct btd_adapter *adapter)
 		g_dbus_send_message(connection, reply);
 	}
 
-	modestr = mode2str(adapter->mode);
-
-	DBG("%s", modestr);
-
 	/* restore if the mode doesn't matches the pending */
 	if (err != 0) {
 		write_device_mode(&adapter->bdaddr, modestr);
-- 
1.7.9.5


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

end of thread, other threads:[~2012-08-27 12:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-08 13:03 [PATCH] Write discoverable mode on storage after HCI response chanyeol.park
2012-08-20 11:25 ` Chan-yeol Park
2012-08-27  9:19   ` [PATCH v2] Fix Discoverable mode is not updated on storage chanyeol.park
2012-08-27 12:02     ` [PATCH v3] storage: Fix Discoverable mode " chanyeol.park
2012-08-27 12:59       ` Luiz Augusto von Dentz

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.