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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc

Issue 301093003: device/bluetooth: Update characteristic value D-Bus bindings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed comments. Created 6 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/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 f2ec8618a5c29a30c75b1fa3a9324bc3e7a04dab..04b0fa3cdb6da107531c4904086befa96683159e 100644
--- a/device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc
@@ -165,6 +165,16 @@ void BluetoothRemoteGattServiceChromeOS::NotifyServiceChanged() {
GattServiceChanged(this));
}
+void BluetoothRemoteGattServiceChromeOS::NotifyCharacteristicValueChanged(
+ BluetoothRemoteGattCharacteristicChromeOS* characteristic,
+ const std::vector<uint8>& value) {
+ DCHECK(characteristic->GetService() == this);
+ FOR_EACH_OBSERVER(
+ device::BluetoothGattService::Observer,
+ observers_,
+ GattCharacteristicValueChanged(this, characteristic, value));
+}
+
void BluetoothRemoteGattServiceChromeOS::NotifyDescriptorAddedOrRemoved(
BluetoothRemoteGattCharacteristicChromeOS* characteristic,
BluetoothRemoteGattDescriptorChromeOS* descriptor,
@@ -250,29 +260,4 @@ void BluetoothRemoteGattServiceChromeOS::GattCharacteristicRemoved(
delete characteristic;
}
-void BluetoothRemoteGattServiceChromeOS::GattCharacteristicPropertyChanged(
- const dbus::ObjectPath& object_path,
- const std::string& property_name) {
- CharacteristicMap::iterator iter = characteristics_.find(object_path);
- if (iter == characteristics_.end()) {
- VLOG(2) << "Unknown GATT characteristic property changed: "
- << object_path.value();
- return;
- }
-
- // Ignore all property changes except for "Value".
- BluetoothGattCharacteristicClient::Properties* properties =
- DBusThreadManager::Get()->GetBluetoothGattCharacteristicClient()->
- GetProperties(object_path);
- DCHECK(properties);
- if (property_name != properties->value.name())
- return;
-
- VLOG(1) << "GATT characteristic value has changed: " << object_path.value()
- << ": " << properties->value.value();
- FOR_EACH_OBSERVER(device::BluetoothGattService::Observer, observers_,
- GattCharacteristicValueChanged(this, iter->second,
- properties->value.value()));
-}
-
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698