linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/2] doc/device-api: Document behavior of Disconnect method with LE
@ 2017-11-20 13:42 Luiz Augusto von Dentz
  2017-11-20 13:42 ` [PATCH BlueZ 2/2] device: Don't disable auto-connect for trusted devices Luiz Augusto von Dentz
  2017-11-20 15:13 ` [PATCH BlueZ 1/2] doc/device-api: Document behavior of Disconnect method with LE Luiz Augusto von Dentz
  0 siblings, 2 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2017-11-20 13:42 UTC (permalink / raw)
  To: linux-bluetooth

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

If and LE device is disconnected using device.Device method it won't
be able to reconnect by itself.
---
 doc/device-api.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/doc/device-api.txt b/doc/device-api.txt
index 13b28818e..ac5604f9c 100644
--- a/doc/device-api.txt
+++ b/doc/device-api.txt
@@ -52,6 +52,10 @@ 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.
+
 			Possible errors: org.bluez.Error.NotConnected
 
 		void ConnectProfile(string uuid)
-- 
2.13.6


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

* [PATCH BlueZ 2/2] device: Don't disable auto-connect for trusted devices
  2017-11-20 13:42 [PATCH BlueZ 1/2] doc/device-api: Document behavior of Disconnect method with LE Luiz Augusto von Dentz
@ 2017-11-20 13:42 ` Luiz Augusto von Dentz
  2017-11-20 14:21   ` Bastien Nocera
  2017-11-20 15:13 ` [PATCH BlueZ 1/2] doc/device-api: Document behavior of Disconnect method with LE Luiz Augusto von Dentz
  1 sibling, 1 reply; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2017-11-20 13:42 UTC (permalink / raw)
  To: linux-bluetooth

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

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


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

* Re: [PATCH BlueZ 2/2] device: Don't disable auto-connect for trusted devices
  2017-11-20 13:42 ` [PATCH BlueZ 2/2] device: Don't disable auto-connect for trusted devices Luiz Augusto von Dentz
@ 2017-11-20 14:21   ` Bastien Nocera
  0 siblings, 0 replies; 4+ messages in thread
From: Bastien Nocera @ 2017-11-20 14:21 UTC (permalink / raw)
  To: Luiz Augusto von Dentz, linux-bluetooth

On Mon, 2017-11-20 at 15:42 +0200, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> Trusted shall indicate if the device is allowed connect in any
> circumstance, even if the user has called device.Disconnect.

This fixes my Bluetooth LE mouse not being able to reconnect to the
computer at all after it was disconnected through a toggle switch,
requiring removing the pairing on the computer, and pairing it again.

But as the device is still able to disconnect, and the mouse just
considers the disconnect a transient transport problem, it will
reconnect straight away.

I might make some changes to the UI to make it clearer that we did
manage to disconnect, and that the device reconnected, otherwise it
looks like the switch didn't work.

So, +1 from me!

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

* Re: [PATCH BlueZ 1/2] doc/device-api: Document behavior of Disconnect method with LE
  2017-11-20 13:42 [PATCH BlueZ 1/2] doc/device-api: Document behavior of Disconnect method with LE Luiz Augusto von Dentz
  2017-11-20 13:42 ` [PATCH BlueZ 2/2] device: Don't disable auto-connect for trusted devices Luiz Augusto von Dentz
@ 2017-11-20 15:13 ` Luiz Augusto von Dentz
  1 sibling, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2017-11-20 15:13 UTC (permalink / raw)
  To: linux-bluetooth@vger.kernel.org

Hi,

On Mon, Nov 20, 2017 at 3:42 PM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> If and LE device is disconnected using device.Device method it won't
> be able to reconnect by itself.
> ---
>  doc/device-api.txt | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/doc/device-api.txt b/doc/device-api.txt
> index 13b28818e..ac5604f9c 100644
> --- a/doc/device-api.txt
> +++ b/doc/device-api.txt
> @@ -52,6 +52,10 @@ 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.
> +
>                         Possible errors: org.bluez.Error.NotConnected
>
>                 void ConnectProfile(string uuid)
> --
> 2.13.6

Applied.


-- 
Luiz Augusto von Dentz

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

end of thread, other threads:[~2017-11-20 15:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-20 13:42 [PATCH BlueZ 1/2] doc/device-api: Document behavior of Disconnect method with LE Luiz Augusto von Dentz
2017-11-20 13:42 ` [PATCH BlueZ 2/2] device: Don't disable auto-connect for trusted devices Luiz Augusto von Dentz
2017-11-20 14:21   ` Bastien Nocera
2017-11-20 15:13 ` [PATCH BlueZ 1/2] doc/device-api: Document behavior of Disconnect method with LE Luiz Augusto von Dentz

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