Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5317)

Unified Diff: device/bluetooth/bluez/bluetooth_device_bluez.h

Issue 1979633004: Invoke GattDiscoveryCompleteForService by observing ServicesResolved property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_attr
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | device/bluetooth/bluez/bluetooth_device_bluez.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluez/bluetooth_device_bluez.h
diff --git a/device/bluetooth/bluez/bluetooth_device_bluez.h b/device/bluetooth/bluez/bluetooth_device_bluez.h
index 293c2466b6dafe10bbf817fd9160660f3b179563..a7576a580e17d23196eee9f29dacee39d57b8d29 100644
--- a/device/bluetooth/bluez/bluetooth_device_bluez.h
+++ b/device/bluetooth/bluez/bluetooth_device_bluez.h
@@ -38,6 +38,7 @@ class BluetoothPairingBlueZ;
// thread.
class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceBlueZ
: public device::BluetoothDevice,
+ public bluez::BluetoothDeviceClient::Observer,
public bluez::BluetoothGattServiceClient::Observer {
public:
// BluetoothDevice override
@@ -124,10 +125,19 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceBlueZ
scoped_refptr<device::BluetoothSocketThread> socket_thread);
~BluetoothDeviceBlueZ() override;
- // bluez::BluetoothGattServiceClient::Observer overrides.
+ // bluez::BluetoothDeviceClient::Observer overrides
+ void DevicePropertyChanged(const dbus::ObjectPath& object_path,
+ const std::string& property_name) override;
+
+ // bluez::BluetoothGattServiceClient::Observer overrides
void GattServiceAdded(const dbus::ObjectPath& object_path) override;
void GattServiceRemoved(const dbus::ObjectPath& object_path) override;
+ // Called by the constructor to initialize the map of GATT services associated
+ // with this device and to invoke NotifyGattDiscoveryComplete() with each
+ // cached service.
+ void InitializeGattServiceMap();
+
// Called by dbus:: on completion of the D-Bus method call to get the
// connection attributes of the current connection to the device.
void OnGetConnInfo(const ConnectionInfoCallback& callback,
@@ -206,6 +216,13 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceBlueZ
scoped_refptr<base::SequencedTaskRunner> ui_task_runner_;
scoped_refptr<device::BluetoothSocketThread> socket_thread_;
+ // This vector temporarily caches the newly added services for later
+ // notification of discovery complete. Once DevicePropertyChange is invoked
+ // with a toggle of ServicesResolved property, the
+ // NotifyGattDiscoveryComplete() will be called with each service once.
+ std::vector<device::BluetoothRemoteGattService*>
+ newly_discovered_gatt_services_;
+
// During pairing this is set to an object that we don't own, but on which
// we can make method calls to request, display or confirm PIN Codes and
// Passkeys. Generally it is the object that owns this one.
« no previous file with comments | « no previous file | device/bluetooth/bluez/bluetooth_device_bluez.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698