[PATCH BlueZ 2/2] device: Don't disable auto-connect for trusted devices

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

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

Trusted shall indicate if the device is allowed connect in any
circumstance, even if the user has called device.Disconnect.
---
 doc/device-api.txt | 6 +++---
 src/device.c       | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/device-api.txt b/doc/device-api.txt
index ac5604f9c..8b69c2ef3 100644
--- a/doc/device-api.txt
+++ b/doc/device-api.txt
@@ -52,9 +52,9 @@ Methods		void Connect()
 			This method can be also used to cancel a preceding
 			Connect call before a reply to it has been received.
 
-			When connected over LE bearer calling this method will
-			prevent incoming connections until Connect method is
-			called again.
+			For non-trusted devices connected over LE bearer calling
+			this method will disable incoming connections until
+			Connect method is called again.
 
 			Possible errors: org.bluez.Error.NotConnected
 
diff --git a/src/device.c b/src/device.c
index e8118112e..a753d2140 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1483,10 +1483,10 @@ static DBusMessage *dev_disconnect(DBusConnection *conn, DBusMessage *msg,
 	struct btd_device *device = user_data;
 
 	/*
-	 * Disable connections through passive scanning until
-	 * Device1.Connect is called
+	 * If device is not trusted disable connections through passive
+	 * scanning until Device1.Connect is called
 	 */
-	if (device->auto_connect) {
+	if (device->auto_connect && !device->trusted) {
 		device->disable_auto_connect = TRUE;
 		device_set_auto_connect(device, FALSE);
 	}
-- 
2.13.6

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