linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Adapter: Fix Discovering state while Powering Off
@ 2012-04-03 11:53 Hemant Gupta
  2012-04-04 10:03 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Hemant Gupta @ 2012-04-03 11:53 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Hemant Gupta, Hemant Gupta

This patch fixes the adater discovering state while powering off.
Without this fix, BlueZ sends incorrect discovering state to upper
layers while switching off.
---
 src/adapter.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index eb9745f..f630196 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2319,10 +2319,17 @@ int btd_adapter_stop(struct btd_adapter *adapter)
 					ADAPTER_INTERFACE, "Pairable",
 					DBUS_TYPE_BOOLEAN, &prop_false);
 
-	if (adapter->discovering)
+	if (adapter->discovering) {
 		emit_property_changed(connection, adapter->path,
 					ADAPTER_INTERFACE, "Discovering",
 					DBUS_TYPE_BOOLEAN, &prop_false);
+		/*
+		 * Change the discovering state to FALSE, otherwise
+		 * inquiry fails to start if BT is switched off and then on
+		 * while inquiry is already active.
+		 */
+		adapter->discovering = FALSE;
+	}
 
 	emit_property_changed(connection, adapter->path, ADAPTER_INTERFACE,
 				"Powered", DBUS_TYPE_BOOLEAN, &prop_false);
-- 
1.7.0.4


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

end of thread, other threads:[~2012-04-04 10:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-03 11:53 [PATCH v2] Adapter: Fix Discovering state while Powering Off Hemant Gupta
2012-04-04 10:03 ` 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).