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

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

Issue 1979163002: Add DBus plumbing and tests for sending devices with ATT read/writes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@devices
Patch Set: gyp fix 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
Index: device/bluetooth/dbus/bluetooth_gatt_characteristic_delegate_wrapper.cc
diff --git a/device/bluetooth/dbus/bluetooth_gatt_characteristic_delegate_wrapper.cc b/device/bluetooth/dbus/bluetooth_gatt_characteristic_delegate_wrapper.cc
index 3373da0d6ba7f87b0e14bd3d8754ca930207456b..12bad3daf691a07f31f00d8775b476c738d4796e 100644
--- a/device/bluetooth/dbus/bluetooth_gatt_characteristic_delegate_wrapper.cc
+++ b/device/bluetooth/dbus/bluetooth_gatt_characteristic_delegate_wrapper.cc
@@ -12,31 +12,36 @@ BluetoothGattCharacteristicDelegateWrapper::
BluetoothGattCharacteristicDelegateWrapper(
BluetoothLocalGattServiceBlueZ* service,
BluetoothLocalGattCharacteristicBlueZ* characteristic)
- : service_(service), characteristic_(characteristic) {}
+ : BluetoothGattAttributeValueDelegate(service),
+ characteristic_(characteristic) {}
void BluetoothGattCharacteristicDelegateWrapper::GetValue(
+ const dbus::ObjectPath& device_path,
const device::BluetoothLocalGattService::Delegate::ValueCallback& callback,
const device::BluetoothLocalGattService::Delegate::ErrorCallback&
error_callback) {
- service_->GetDelegate()->OnCharacteristicReadRequest(
- nullptr, characteristic_, 0, callback, error_callback);
+ service()->GetDelegate()->OnCharacteristicReadRequest(
+ GetDeviceWithPath(device_path), characteristic_, 0, callback,
+ error_callback);
}
void BluetoothGattCharacteristicDelegateWrapper::SetValue(
+ const dbus::ObjectPath& device_path,
const std::vector<uint8_t>& value,
const base::Closure& callback,
const device::BluetoothLocalGattService::Delegate::ErrorCallback&
error_callback) {
- service_->GetDelegate()->OnCharacteristicWriteRequest(
- nullptr, characteristic_, value, 0, callback, error_callback);
+ service()->GetDelegate()->OnCharacteristicWriteRequest(
+ GetDeviceWithPath(device_path), characteristic_, value, 0, callback,
+ error_callback);
}
void BluetoothGattCharacteristicDelegateWrapper::StartNotifications() {
- service_->GetDelegate()->OnNotificationsStart(nullptr, characteristic_);
+ service()->GetDelegate()->OnNotificationsStart(nullptr, characteristic_);
}
void BluetoothGattCharacteristicDelegateWrapper::StopNotifications() {
- service_->GetDelegate()->OnNotificationsStop(nullptr, characteristic_);
+ service()->GetDelegate()->OnNotificationsStop(nullptr, characteristic_);
}
} // namespace bluez

Powered by Google App Engine
This is Rietveld 408576698