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

Unified Diff: device/bluetooth/dbus/fake_bluetooth_gatt_descriptor_service_provider.cc

Issue 1920693002: Complete //device/bt implementation for hosting local GATT attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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_descriptor_service_provider.cc
diff --git a/device/bluetooth/dbus/fake_bluetooth_gatt_descriptor_service_provider.cc b/device/bluetooth/dbus/fake_bluetooth_gatt_descriptor_service_provider.cc
index 78a504e92b52bdf63e447b639b2a17daec77724f..6ef1bde91fbbfd13e1d74c5ccf5b419e6a092927 100644
--- a/device/bluetooth/dbus/fake_bluetooth_gatt_descriptor_service_provider.cc
+++ b/device/bluetooth/dbus/fake_bluetooth_gatt_descriptor_service_provider.cc
@@ -15,7 +15,7 @@ namespace bluez {
FakeBluetoothGattDescriptorServiceProvider::
FakeBluetoothGattDescriptorServiceProvider(
const dbus::ObjectPath& object_path,
- Delegate* delegate,
+ BluetoothGattServiceBlueZ::AttributeValueDelegate* delegate,
const std::string& uuid,
const std::vector<std::string>& permissions,
const dbus::ObjectPath& characteristic_path)
@@ -29,9 +29,6 @@ FakeBluetoothGattDescriptorServiceProvider::
DCHECK(characteristic_path_.IsValid());
DCHECK(!uuid.empty());
DCHECK(delegate_);
- DCHECK(base::StartsWith(object_path_.value(),
- characteristic_path_.value() + "/",
- base::CompareCase::SENSITIVE));
// TODO(armansito): Do something with |permissions|.
@@ -58,11 +55,11 @@ void FakeBluetoothGattDescriptorServiceProvider::SendValueChanged(
}
void FakeBluetoothGattDescriptorServiceProvider::GetValue(
- const Delegate::ValueCallback& callback,
- const Delegate::ErrorCallback& error_callback) {
+ const device::BluetoothLocalGattService::Delegate::ValueCallback& callback,
+ const device::BluetoothLocalGattService::Delegate::ErrorCallback&
+ error_callback) {
VLOG(1) << "GATT descriptor value Get request: " << object_path_.value()
<< " UUID: " << uuid_;
-
// Check if this descriptor is registered.
FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client =
static_cast<FakeBluetoothGattManagerClient*>(
@@ -84,13 +81,14 @@ void FakeBluetoothGattDescriptorServiceProvider::GetValue(
// Pass on to the delegate.
DCHECK(delegate_);
- delegate_->GetDescriptorValue(callback, error_callback);
+ delegate_->GetValue(callback, error_callback);
}
void FakeBluetoothGattDescriptorServiceProvider::SetValue(
const std::vector<uint8_t>& value,
const base::Closure& callback,
- const Delegate::ErrorCallback& error_callback) {
+ const device::BluetoothLocalGattService::Delegate::ErrorCallback&
+ error_callback) {
VLOG(1) << "GATT descriptor value Set request: " << object_path_.value()
<< " UUID: " << uuid_;
@@ -115,7 +113,12 @@ void FakeBluetoothGattDescriptorServiceProvider::SetValue(
// Pass on to the delegate.
DCHECK(delegate_);
- delegate_->SetDescriptorValue(value, callback, error_callback);
+ delegate_->SetValue(value, callback, error_callback);
+}
+
+const dbus::ObjectPath&
+FakeBluetoothGattDescriptorServiceProvider::object_path() const {
+ return object_path_;
}
} // namespace bluez

Powered by Google App Engine
This is Rietveld 408576698