[PATCH 1/2] Improve the logic when emitting Discovering signal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/adapter.c |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index 031e141..69fd5be 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2826,19 +2826,18 @@ void adapter_set_state(struct btd_adapter *adapter, int state)
 			return;
 		break;
 	case STATE_LE_SCAN:
-		/* Scanning enabled */
-		if (adapter->disc_sessions) {
-			adapter->stop_discov_id = g_timeout_add(5120,
-								stop_scanning,
-								adapter);
+		discov_active = TRUE;
 
-			/* For dual mode: don't send "Discovering = TRUE"  */
-			if (bredr_capable(adapter) == TRUE)
-				return;
-		}
+		if (!adapter->disc_sessions)
+			break;
 
-		/* LE only */
-		discov_active = TRUE;
+		/* Scanning enabled */
+		adapter->stop_discov_id = g_timeout_add(5120, stop_scanning,
+							adapter);
+
+		/* For dual mode: don't send "Discovering = TRUE"  */
+		if (bredr_capable(adapter) == TRUE)
+			return;
 
 		break;
 	case STATE_IDLE:
-- 
1.7.4.1

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


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux