| Index: device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_service_provider.cc
|
| diff --git a/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_service_provider.cc b/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_service_provider.cc
|
| index 4e60936116640cd75356427cbc00cc3244769bf9..10769ca0cfa9423e9b9b8f6875fc59555ba31e78 100644
|
| --- a/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_service_provider.cc
|
| +++ b/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_service_provider.cc
|
| @@ -14,7 +14,8 @@ namespace bluez {
|
| FakeBluetoothGattCharacteristicServiceProvider::
|
| FakeBluetoothGattCharacteristicServiceProvider(
|
| const dbus::ObjectPath& object_path,
|
| - Delegate* delegate,
|
| + std::unique_ptr<BluetoothGattServiceBlueZ::AttributeValueDelegate>
|
| + delegate,
|
| const std::string& uuid,
|
| const std::vector<std::string>& flags,
|
| const std::vector<std::string>& permissions,
|
| @@ -22,18 +23,15 @@ FakeBluetoothGattCharacteristicServiceProvider::
|
| : object_path_(object_path),
|
| uuid_(uuid),
|
| service_path_(service_path),
|
| - delegate_(delegate) {
|
| + delegate_(std::move(delegate)) {
|
| VLOG(1) << "Creating Bluetooth GATT characteristic: " << object_path_.value();
|
|
|
| DCHECK(object_path_.IsValid());
|
| DCHECK(service_path_.IsValid());
|
| DCHECK(!uuid.empty());
|
| DCHECK(delegate_);
|
| - DCHECK(base::StartsWith(object_path_.value(), service_path_.value() + "/",
|
| - base::CompareCase::SENSITIVE));
|
|
|
| // TODO(armansito): Do something with |flags| and |permissions|.
|
| -
|
| FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client =
|
| static_cast<FakeBluetoothGattManagerClient*>(
|
| bluez::BluezDBusManager::Get()->GetBluetoothGattManagerClient());
|
| @@ -45,7 +43,6 @@ FakeBluetoothGattCharacteristicServiceProvider::
|
| ~FakeBluetoothGattCharacteristicServiceProvider() {
|
| VLOG(1) << "Cleaning up Bluetooth GATT characteristic: "
|
| << object_path_.value();
|
| -
|
| FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client =
|
| static_cast<FakeBluetoothGattManagerClient*>(
|
| bluez::BluezDBusManager::Get()->GetBluetoothGattManagerClient());
|
| @@ -60,11 +57,11 @@ void FakeBluetoothGattCharacteristicServiceProvider::SendValueChanged(
|
| }
|
|
|
| void FakeBluetoothGattCharacteristicServiceProvider::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 characteristic value Get request: " << object_path_.value()
|
| << " UUID: " << uuid_;
|
| -
|
| // Check if this characteristic is registered.
|
| FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client =
|
| static_cast<FakeBluetoothGattManagerClient*>(
|
| @@ -77,16 +74,16 @@ void FakeBluetoothGattCharacteristicServiceProvider::GetValue(
|
|
|
| // Pass on to the delegate.
|
| DCHECK(delegate_);
|
| - delegate_->GetCharacteristicValue(callback, error_callback);
|
| + delegate_->GetValue(callback, error_callback);
|
| }
|
|
|
| void FakeBluetoothGattCharacteristicServiceProvider::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 characteristic value Set request: " << object_path_.value()
|
| << " UUID: " << uuid_;
|
| -
|
| // Check if this characteristic is registered.
|
| FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client =
|
| static_cast<FakeBluetoothGattManagerClient*>(
|
| @@ -99,7 +96,12 @@ void FakeBluetoothGattCharacteristicServiceProvider::SetValue(
|
|
|
| // Pass on to the delegate.
|
| DCHECK(delegate_);
|
| - delegate_->SetCharacteristicValue(value, callback, error_callback);
|
| + delegate_->SetValue(value, callback, error_callback);
|
| +}
|
| +
|
| +const dbus::ObjectPath&
|
| +FakeBluetoothGattCharacteristicServiceProvider::object_path() const {
|
| + return object_path_;
|
| }
|
|
|
| } // namespace bluez
|
|
|