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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_service_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: rebase & tbr Created 5 years, 10 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
« no previous file with comments | « device/bluetooth/bluetooth_remote_gatt_service_chromeos.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc
diff --git a/device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc b/device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc
index 8657abdc1604c68cb212d4ef222982c14413b6a7..bd243d88046e10755f18aa9fd920873526b5c8cb 100644
--- a/device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc
@@ -195,14 +195,6 @@ void BluetoothRemoteGattServiceChromeOS::NotifyServiceChanged() {
adapter_->NotifyGattServiceChanged(this);
}
-void BluetoothRemoteGattServiceChromeOS::NotifyCharacteristicValueChanged(
- BluetoothRemoteGattCharacteristicChromeOS* characteristic,
- const std::vector<uint8>& value) {
- DCHECK(characteristic->GetService() == this);
- DCHECK(adapter_);
- adapter_->NotifyGattCharacteristicValueChanged(characteristic, value);
-}
-
void BluetoothRemoteGattServiceChromeOS::NotifyDescriptorAddedOrRemoved(
BluetoothRemoteGattCharacteristicChromeOS* characteristic,
BluetoothRemoteGattDescriptorChromeOS* descriptor,
@@ -311,7 +303,8 @@ void BluetoothRemoteGattServiceChromeOS::GattCharacteristicRemoved(
void BluetoothRemoteGattServiceChromeOS::GattCharacteristicPropertyChanged(
const dbus::ObjectPath& object_path,
const std::string& property_name) {
- if (characteristics_.find(object_path) == characteristics_.end()) {
+ CharacteristicMap::iterator iter = characteristics_.find(object_path);
+ if (iter == characteristics_.end()) {
VLOG(3) << "Properties of unknown characteristic changed";
return;
}
@@ -324,11 +317,15 @@ void BluetoothRemoteGattServiceChromeOS::GattCharacteristicPropertyChanged(
BluetoothGattCharacteristicClient::Properties* properties =
DBusThreadManager::Get()->GetBluetoothGattCharacteristicClient()->
GetProperties(object_path);
+
DCHECK(properties);
- if (property_name != properties->flags.name())
- return;
+ DCHECK(adapter_);
- NotifyServiceChanged();
+ if (property_name == properties->flags.name())
+ NotifyServiceChanged();
+ else if (property_name == properties->value.name())
+ adapter_->NotifyGattCharacteristicValueChanged(iter->second,
+ properties->value.value());
}
} // namespace chromeos
« no previous file with comments | « device/bluetooth/bluetooth_remote_gatt_service_chromeos.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698