diff mbox series

[BlueZ,v2,2/2] device: set le_state.svc_resolved = false in gatt_cache_cleanup()

Message ID 20210825165125.2675544-3-david@lechnology.com (mailing list archive)
State Accepted
Delegated to: Luiz Von Dentz
Headers show
Series device: fix advertising data UUIDs ignored when Cache = yes | expand

Commit Message

David Lechner Aug. 25, 2021, 4:51 p.m. UTC
When the GATT cache is cleared, there is no longer a list of GATT
services, so we need to set le_state.svc_resolved = false so that
the next time the device connects, it will enumerate the services
again.

This partially fixes an issue where the UUIDs D-Bus property was empty
after scanning, connecting, disconnecting and scanning again when
[GATT] Cache = yes is set in main.conf.

Issue: https://github.com/bluez/bluez/issues/192
Suggested-by: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Signed-off-by: David Lechner <david@lechnology.com>
---
 src/device.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/src/device.c b/src/device.c
index 53ef3e9a1..6d534c488 100644
--- a/src/device.c
+++ b/src/device.c
@@ -580,6 +580,7 @@  static void gatt_cache_cleanup(struct btd_device *device)
 
 	bt_gatt_client_cancel_all(device->client);
 	gatt_db_clear(device->db);
+	device->le_state.svc_resolved = false;
 }
 
 static void gatt_client_cleanup(struct btd_device *device)