diff mbox series

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

Message ID 20230728052506.582394-2-simon.mikuda@streamunlimited.com (mailing list archive)
State New, archived
Headers show
Series Adapter1.ConnectDevice | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake success Bluez Make PASS
tedd_an/MakeCheck success Bluez Make Check PASS
tedd_an/MakeDistcheck success Make Distcheck PASS
tedd_an/CheckValgrind success Check Valgrind PASS
tedd_an/CheckSmatch success CheckSparse PASS
tedd_an/bluezmakeextell success Make External ELL PASS
tedd_an/IncrementalBuild success Incremental Build PASS
tedd_an/ScanBuild success Scan Build PASS

Commit Message

Simon Mikuda July 28, 2023, 5:25 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).
---
 doc/adapter-api.txt | 2 +-
 src/adapter.c       | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

Comments

bluez.test.bot@gmail.com July 28, 2023, 6:33 a.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=770400

---Test result---

Test Summary:
CheckPatch                    PASS      0.38 seconds
GitLint                       PASS      0.29 seconds
BuildEll                      PASS      27.01 seconds
BluezMake                     PASS      793.15 seconds
MakeCheck                     PASS      12.10 seconds
MakeDistcheck                 PASS      159.63 seconds
CheckValgrind                 PASS      252.47 seconds
CheckSmatch                   PASS      338.10 seconds
bluezmakeextell               PASS      102.34 seconds
IncrementalBuild              PASS      657.82 seconds
ScanBuild                     PASS      1022.18 seconds



---
Regards,
Linux Bluetooth
Luiz Augusto von Dentz July 28, 2023, 5:48 p.m. UTC | #2
Hi Simon,

On Thu, Jul 27, 2023 at 10:46 PM 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).
> ---
>  doc/adapter-api.txt | 2 +-
>  src/adapter.c       | 3 ---
>  2 files changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/doc/adapter-api.txt b/doc/adapter-api.txt
> index 9b2721c1b..239d9463d 100644
> --- a/doc/adapter-api.txt
> +++ b/doc/adapter-api.txt
> @@ -182,7 +182,7 @@ Methods             void StartDiscovery()
>                         profile will be connected. There is no need for calling
>                         Connect on Device1 after this call. If connection was
>                         successful this method returns object path to created
> -                       device object.
> +                       device object or device that already exist.

Perhaps we should mention the intent here is to allow applications to
specify what bearer to connect as opposed to Device.Connect that
connects on the last seen bearer first.

>
>                         Parameters that may be set in the filter dictionary
>                         include the following:
> 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
>
diff mbox series

Patch

diff --git a/doc/adapter-api.txt b/doc/adapter-api.txt
index 9b2721c1b..239d9463d 100644
--- a/doc/adapter-api.txt
+++ b/doc/adapter-api.txt
@@ -182,7 +182,7 @@  Methods		void StartDiscovery()
 			profile will be connected. There is no need for calling
 			Connect on Device1 after this call. If connection was
 			successful this method returns object path to created
-			device object.
+			device object or device that already exist.
 
 			Parameters that may be set in the filter dictionary
 			include the following:
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;
 }