All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v1] gas: Fix reading attributes on every connection
@ 2024-06-18 19:59 Luiz Augusto von Dentz
  2024-06-18 21:42 ` [BlueZ,v1] " bluez.test.bot
  2024-06-19 14:10 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2024-06-18 19:59 UTC (permalink / raw)
  To: linux-bluetooth

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

Attributes only need to be read once after that they will be persisted
by the core so there is no need to keep reading them on every
reconnection.
---
 profiles/gap/gas.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/profiles/gap/gas.c b/profiles/gap/gas.c
index dbe5f003bfba..08aaf19cb332 100644
--- a/profiles/gap/gas.c
+++ b/profiles/gap/gas.c
@@ -342,6 +342,10 @@ static int gap_accept(struct btd_service *service)
 		goto _finish;
 	}
 
+	/* Check if attribute already has been discovered */
+	if (gas->attr)
+		goto _finish;
+
 	gas->db = gatt_db_ref(db);
 	gas->client = bt_gatt_client_clone(client);
 
@@ -364,10 +368,6 @@ _finish:
 
 static int gap_disconnect(struct btd_service *service)
 {
-	struct gas *gas = btd_service_get_user_data(service);
-
-	gas_reset(gas);
-
 	btd_service_disconnecting_complete(service, 0);
 
 	return 0;
-- 
2.45.2


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

end of thread, other threads:[~2024-06-19 14:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-18 19:59 [PATCH BlueZ v1] gas: Fix reading attributes on every connection Luiz Augusto von Dentz
2024-06-18 21:42 ` [BlueZ,v1] " bluez.test.bot
2024-06-19 14:10 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.