[PATCH] android/bluetooth: Change discoverable mode only if connectable

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

 



There is no need to sending set_discoverable command if new settings
are not connectable as clearing connectable also clear discoverable.
Sending set_discoverable when not connectable result in 'rejected'
mgmt response.
---
 android/bluetooth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/android/bluetooth.c b/android/bluetooth.c
index aa684bd..ffca084 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -1907,7 +1907,7 @@ static uint8_t set_scan_mode(void *buf, uint16_t len)
 			return HAL_STATUS_FAILED;
 	}
 
-	if (cur_disc != disc) {
+	if (cur_disc != disc && conn) {
 		if (!set_discoverable(disc ? 0x01 : 0x00, 0))
 			return HAL_STATUS_FAILED;
 	}
-- 
1.8.3.2

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