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, |