public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v1] gatt-client: Fix warnings when reconnecting
@ 2025-01-24 20:57 Luiz Augusto von Dentz
  2025-01-24 22:08 ` [BlueZ,v1] " bluez.test.bot
  2025-01-27 15:10 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2025-01-24 20:57 UTC (permalink / raw)
  To: linux-bluetooth

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

When reconnecting warnings could be seen due to services already
existing which is a new behavior introduced by dbd6591bd1d0
("main.conf: Add GATT.ExportClaimedServices").
---
 src/gatt-client.c | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/src/gatt-client.c b/src/gatt-client.c
index 6f22bbb490a7..da7c16fc14af 100644
--- a/src/gatt-client.c
+++ b/src/gatt-client.c
@@ -1968,12 +1968,33 @@ static void service_free(void *data)
 	free(service);
 }
 
+static bool match_service_handle(const void *a, const void *b)
+{
+	const struct service *service = a;
+	uint16_t start_handle = PTR_TO_UINT(b);
+
+	return service->start_handle == start_handle;
+}
+
 static struct service *service_create(struct gatt_db_attribute *attr,
 						struct btd_gatt_client *client)
 {
 	struct service *service;
 	const char *device_path = device_get_path(client->device);
 	bt_uuid_t uuid;
+	uint16_t start_handle, end_handle;
+	bool primary;
+
+	gatt_db_attribute_get_service_data(attr, &start_handle,
+							&end_handle,
+							&primary,
+							&uuid);
+
+	/* Check if service is already on list then return NULL to skip it */
+	service = queue_find(client->services, match_service_handle,
+						UINT_TO_PTR(start_handle));
+	if (service)
+		return NULL;
 
 	service = new0(struct service, 1);
 	service->chrcs = queue_new();
@@ -2146,14 +2167,6 @@ static void export_service(struct gatt_db_attribute *attr, void *user_data)
 	queue_push_tail(client->services, service);
 }
 
-static bool match_service_handle(const void *a, const void *b)
-{
-	const struct service *service = a;
-	uint16_t start_handle = PTR_TO_UINT(b);
-
-	return service->start_handle == start_handle;
-}
-
 struct update_incl_data {
 	struct service *service;
 	bool changed;
-- 
2.48.1


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

* RE: [BlueZ,v1] gatt-client: Fix warnings when reconnecting
  2025-01-24 20:57 [PATCH BlueZ v1] gatt-client: Fix warnings when reconnecting Luiz Augusto von Dentz
@ 2025-01-24 22:08 ` bluez.test.bot
  2025-01-27 15:10 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2025-01-24 22:08 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 1260 bytes --]

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

---Test result---

Test Summary:
CheckPatch                    PENDING   0.20 seconds
GitLint                       PENDING   0.20 seconds
BuildEll                      PASS      20.54 seconds
BluezMake                     PASS      1569.00 seconds
MakeCheck                     PASS      13.66 seconds
MakeDistcheck                 PASS      163.18 seconds
CheckValgrind                 PASS      217.77 seconds
CheckSmatch                   PASS      273.84 seconds
bluezmakeextell               PASS      99.39 seconds
IncrementalBuild              PENDING   0.27 seconds
ScanBuild                     PASS      869.53 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ v1] gatt-client: Fix warnings when reconnecting
  2025-01-24 20:57 [PATCH BlueZ v1] gatt-client: Fix warnings when reconnecting Luiz Augusto von Dentz
  2025-01-24 22:08 ` [BlueZ,v1] " bluez.test.bot
@ 2025-01-27 15:10 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2025-01-27 15:10 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Fri, 24 Jan 2025 15:57:00 -0500 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> When reconnecting warnings could be seen due to services already
> existing which is a new behavior introduced by dbd6591bd1d0
> ("main.conf: Add GATT.ExportClaimedServices").
> ---
>  src/gatt-client.c | 29 +++++++++++++++++++++--------
>  1 file changed, 21 insertions(+), 8 deletions(-)

Here is the summary with links:
  - [BlueZ,v1] gatt-client: Fix warnings when reconnecting
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=29f0bdb545a4

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-01-27 15:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-24 20:57 [PATCH BlueZ v1] gatt-client: Fix warnings when reconnecting Luiz Augusto von Dentz
2025-01-24 22:08 ` [BlueZ,v1] " bluez.test.bot
2025-01-27 15:10 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox