Retrieve Gatt Service information for device::BluetoothAdapter::NotifyGattDiscoveryComplete in BlueZ implementation |
|||
Issue descriptionAfter BlueZ 5.39 uprev, ServicesResolved[1] property is added to org.bluez.Device1 interface, and it toggles whenever the services associated with the device are fully discovered. Instead of rely on GattServiceAdded()[2], NotifyGattDiscoveryComplete[3] should be invoked whenever ServicesResolved property changes to true. However, DevicePropertyChanged[4] does not provide the information of the newly-added/newly-removed service, so there is no proper way to call NotifyGattDiscoveryComplete with the corresponding device::BluetoothRemoteGattService pointer. [1] http://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/device-api.txt#n215 [2] https://code.google.com/p/chromium/codesearch#chromium/src/device/bluetooth/dbus/bluetooth_gatt_service_client.h&q=GattServiceAdded&sq=package:chromium&type=cs&l=56 [3] https://code.google.com/p/chromium/codesearch#chromium/src/device/bluetooth/bluetooth_adapter.h&q=NotifyGattDiscoveryComplete&sq=package:chromium&type=cs&l=441 [4] https://code.google.com/p/chromium/codesearch#chromium/src/device/bluetooth/dbus/bluetooth_device_client.h&q=DevicePropertyChanged&sq=package:chromium&type=cs&l=114 This probably requires BlueZ changes and also the corresponding changes in Chrome APIs.
,
May 12 2016
,
May 12 2016
So looking at the CL, this is not needed. I agree with ortuno@. ServicesResolved will only be called once for a device (if it is called more than once, we should fix that). Once it is called, just call discovery complete for service on all services.
,
May 12 2016
"if it is called more than once, we should fix that". ServicesResolved being called more than once is normal behavior: A device can send a services change notification which would trigger a services rediscovery which will toggle the property. So our code does indeed need to keep track of services for which we've notify of discovery. I'm aware that it's weird that a we don't notify clients if a service discovery has been re triggered but my goal here is to keep the behavior for the clients that currently depend on the GattDiscoveryCompleteForService the same. I think long term we want to get rid of that event completely.
,
May 12 2016
This is true. In either case, it doesn't effect this bug. We should still call GattDiscoveryCompleteForService for all services once we receive the services resolved notification.
,
May 17 2016
As ortuno@ mentioned in comment #4, ServicesResolved will be triggered again for new objects. So we agree that NotifyGattDiscoveryComplete() should be invoked multiple time with newly-added services when the ServicesResolved becomes true. |
|||
►
Sign in to add a comment |
|||
Comment 1 by ortuno@chromium.org
, May 12 2016