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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_descriptor_chromeos.cc

Issue 788193004: chromeos/dbus: Update Bluetooth GATT API clients to upstream definition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/bluetooth_remote_gatt_descriptor_chromeos.cc
diff --git a/device/bluetooth/bluetooth_remote_gatt_descriptor_chromeos.cc b/device/bluetooth/bluetooth_remote_gatt_descriptor_chromeos.cc
index 82a7f66317a19f9429fc5566d04e9c356ef13f24..da3856691bc0499e62b31dcc010afa3eb2cccefa 100644
--- a/device/bluetooth/bluetooth_remote_gatt_descriptor_chromeos.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_descriptor_chromeos.cc
@@ -60,7 +60,14 @@ bool BluetoothRemoteGattDescriptorChromeOS::IsLocal() const {
const std::vector<uint8>&
BluetoothRemoteGattDescriptorChromeOS::GetValue() const {
- return cached_value_;
+ BluetoothGattDescriptorClient::Properties* properties =
+ DBusThreadManager::Get()
+ ->GetBluetoothGattDescriptorClient()
+ ->GetProperties(object_path_);
+
+ DCHECK(properties);
+
+ return properties->value.value();
}
device::BluetoothGattCharacteristic*
@@ -83,13 +90,9 @@ void BluetoothRemoteGattDescriptorChromeOS::ReadRemoteDescriptor(
<< GetUUID().canonical_value();
DBusThreadManager::Get()->GetBluetoothGattDescriptorClient()->ReadValue(
- object_path_,
- base::Bind(&BluetoothRemoteGattDescriptorChromeOS::OnValueSuccess,
- weak_ptr_factory_.GetWeakPtr(),
- callback),
+ object_path_, callback,
base::Bind(&BluetoothRemoteGattDescriptorChromeOS::OnError,
- weak_ptr_factory_.GetWeakPtr(),
- error_callback));
+ weak_ptr_factory_.GetWeakPtr(), error_callback));
}
void BluetoothRemoteGattDescriptorChromeOS::WriteRemoteDescriptor(
@@ -110,21 +113,6 @@ void BluetoothRemoteGattDescriptorChromeOS::WriteRemoteDescriptor(
error_callback));
}
-void BluetoothRemoteGattDescriptorChromeOS::OnValueSuccess(
- const ValueCallback& callback,
- const std::vector<uint8>& value) {
- VLOG(1) << "Descriptor value read: " << value;
- cached_value_ = value;
-
- DCHECK(characteristic_);
- BluetoothRemoteGattServiceChromeOS* service =
- static_cast<BluetoothRemoteGattServiceChromeOS*>(
- characteristic_->GetService());
- DCHECK(service);
- service->NotifyDescriptorValueChanged(characteristic_, this, value);
- callback.Run(value);
-}
-
void BluetoothRemoteGattDescriptorChromeOS::OnError(
const ErrorCallback& error_callback,
const std::string& error_name,

Powered by Google App Engine
This is Rietveld 408576698