mbox series

[BlueZ,v2,0/2] device: fix advertising data UUIDs ignored when Cache = yes

Message ID 20210825165125.2675544-1-david@lechnology.com
Headers show
Series device: fix advertising data UUIDs ignored when Cache = yes | expand

Message

David Lechner Aug. 25, 2021, 4:51 p.m. UTC
When [GATT] Cache = yes is set in configuration BlueZ does not use
cached UUIDs for the list of service UUIDs. However, it doesn't clear
the in-memory list of UUIDs received from advertising data, so when
a device is scanned, connected and disconnected, the internal state
still reflects that the UUIDs from the advertising data have already
been handled. device_add_eir_uuids() ignored the UUIDs from the
advertising data because both dev->le_state.svc_resolved == true and
dev->eir_uuids still contains the UUIDs from the previous scan session.

v2 changes:
* split into two patches
* always clear eir_uuids list on disconnect
* move le_state.svc_resolved = false to gatt_cache_cleanup()

Issue: https://github.com/bluez/bluez/issues/192

David Lechner (2):
  device: clear eir_uuids list on disconnect
  device: set le_state.svc_resolved = false in gatt_cache_cleanup()

 src/device.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

David Lechner Aug. 26, 2021, 4:47 p.m. UTC | #1
On 8/25/21 11:24 PM, Eisenkolb Thomas wrote:
> Hello,

> 

> I have just found the same problem even if [GATT] Cache = no is set in main.conf.

> It is simply the same because the device is held as temporary device.

> 

> Additionally the method "dev_property_get_uuids" in device.c only returns UUIDs of

> the cached (temporary hold) device because dev->le_state.svc_resolved is not turned

> to false on disconnect. So if a disconnected device advertised an new UUID, you never

> get notified about it through dbus.

> 

> Through DBus device node I would expect to get both UUID lists. The cached ones and

> also the advertised ones.

> Actually I just merge the two lists and provide the result to DBus device->UUIDs request.

> 

> Hope you can change this.

> 


This series has already been applied, so it can't be changed.

If you are still having problems after this series, can you share some
logs so that we can see exactly the problem?