diff mbox series

[BlueZ,2/8] adapter: Be able to use ConnectDevice for discovered devices

Message ID 20230725084431.640332-3-simon.mikuda@streamunlimited.com
State Superseded
Headers show
Series Various fixes and refactors | expand

Commit Message

Simon Mikuda July 25, 2023, 8:44 a.m. UTC
This can be useful when you want to specify trasport type for already
paired device (e.g. use LE transport for dual mode device).
---
 src/adapter.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Luiz Augusto von Dentz July 27, 2023, 6:52 p.m. UTC | #1
Hi Simon,

On Tue, Jul 25, 2023 at 1:56 AM Simon Mikuda
<simon.mikuda@streamunlimited.com> wrote:
>
> This can be useful when you want to specify trasport type for already
> paired device (e.g. use LE transport for dual mode device).
> ---
>  src/adapter.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/src/adapter.c b/src/adapter.c
> index 2679d4302..17f4a637d 100644
> --- a/src/adapter.c
> +++ b/src/adapter.c
> @@ -3763,9 +3763,6 @@ static DBusMessage *connect_device(DBusConnection *conn,
>         if (!bacmp(&addr, BDADDR_ANY))
>                 return btd_error_invalid_args(msg);
>
> -       if (btd_adapter_find_device(adapter, &addr, addr_type))
> -               return btd_error_already_exists(msg);
> -
>         device_connect(adapter, &addr, addr_type, msg);
>         return NULL;
>  }
> --
> 2.34.1

While this is probably a good idea we need to document it on
adapter-api first, also not that Device.Connect could be used a second
time to connect both transports but this seems to be a better
alternative if one wants to bypass the daemon policy of connecting the
last seen bearer first.
diff mbox series

Patch

diff --git a/src/adapter.c b/src/adapter.c
index 2679d4302..17f4a637d 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -3763,9 +3763,6 @@  static DBusMessage *connect_device(DBusConnection *conn,
 	if (!bacmp(&addr, BDADDR_ANY))
 		return btd_error_invalid_args(msg);
 
-	if (btd_adapter_find_device(adapter, &addr, addr_type))
-		return btd_error_already_exists(msg);
-
 	device_connect(adapter, &addr, addr_type, msg);
 	return NULL;
 }