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

Unified Diff: device/bluetooth/dbus/fake_bluetooth_gatt_service_client.h

Issue 2105423003: bluetooth: Update the map of GATT services when services resolve (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Address luiz's comments Created 4 years, 5 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
Index: device/bluetooth/dbus/fake_bluetooth_gatt_service_client.h
diff --git a/device/bluetooth/dbus/fake_bluetooth_gatt_service_client.h b/device/bluetooth/dbus/fake_bluetooth_gatt_service_client.h
index d56a35527f2a5a49d74ec3e1a68c33432d61ea9a..44ac42a80babddbc0510a5a7e5c19a167efdc97c 100644
--- a/device/bluetooth/dbus/fake_bluetooth_gatt_service_client.h
+++ b/device/bluetooth/dbus/fake_bluetooth_gatt_service_client.h
@@ -55,18 +55,24 @@ class DEVICE_BLUETOOTH_EXPORT FakeBluetoothGattServiceClient
void ExposeHeartRateService(const dbus::ObjectPath& device_path);
void HideHeartRateService();
- // Makes a service visible for device with object path |device_path| without
- // delay. Note that only one instance of a specific service is simulated at a
- // time, if the service is already visible.
- void ExposeHeartRateServiceWithoutDelay(const dbus::ObjectPath& device_path);
+ // Makes a service visible for device with object path |device_path|. Note
+ // that only one instance of a specific service is simulated at a time. Hence,
+ // this method will fail, if the service is already visible.
+ void ExposeBatteryService(const dbus::ObjectPath& device_path);
// Returns whether or not the Heart Rate Service is visible.
bool IsHeartRateVisible() const;
+ // Returns whether or not the Battery Service is visible.
+ bool IsBatteryServiceVisible() const;
// Returns the current object path of the visible Heart Rate service. If the
// service is not visible, returns an invalid empty path.
dbus::ObjectPath GetHeartRateServicePath() const;
+ // Returns the current object path of the visible Battery service. If the
+ // service is not visible, returns an invalid empty path.
+ dbus::ObjectPath GetBatteryServicePath() const;
+
// Final object path components and the corresponding UUIDs of the GATT
// services that we emulate. Service paths are hierarchical to Bluetooth
// device paths, so if the path component is "service0000", and the device
@@ -75,6 +81,14 @@ class DEVICE_BLUETOOTH_EXPORT FakeBluetoothGattServiceClient
static const char kHeartRateServicePathComponent[];
static const char kHeartRateServiceUUID[];
+ // Final object path components and the corresponding UUIDs of the GATT
+ // services that we emulate. Service paths are hierarchical to Bluetooth
+ // device paths, so if the path component is "service0001", and the device
+ // path is "/org/foo/device0", the service path is
+ // "/org/foo/device0/service0001".
+ static const char kBatteryServicePathComponent[];
+ static const char kBatteryServiceUUID[];
+
private:
// Property callback passed when we create Properties structures.
void OnPropertyChanged(const dbus::ObjectPath& object_path,
@@ -90,15 +104,12 @@ class DEVICE_BLUETOOTH_EXPORT FakeBluetoothGattServiceClient
// time this method is called, then it does nothing.
void ExposeHeartRateCharacteristics();
- // Toggles the ServicesResolved property for the device with |object_path|.
- // This should be done after a service is fully discovered.
- void ToggleServicesResolvedProperty(const dbus::ObjectPath& object_path,
- bool resolved);
-
// Static properties we return. As long as a service is exposed, this will be
// non-null. Otherwise it will be null.
std::unique_ptr<Properties> heart_rate_service_properties_;
+ std::unique_ptr<Properties> battery_service_properties_;
std::string heart_rate_service_path_;
+ std::string battery_service_path_;
// List of observers interested in event notifications from us.
base::ObserverList<Observer> observers_;

Powered by Google App Engine
This is Rietveld 408576698