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

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: Removed unusued function for compile warning Created 6 years, 6 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 e4b0ae2bc7c374a0452085c0b92633762604ca4b..81aaa3d0eae14ef81e7d0cafa4f4231d0e9f45c9 100644
--- a/device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc
@@ -14,20 +14,6 @@
namespace chromeos {
-namespace {
-
-// Stream operator for logging vector<uint8>.
-std::ostream& operator<<(std::ostream& out, const std::vector<uint8> bytes) {
- out << "[";
- for (std::vector<uint8>::const_iterator iter = bytes.begin();
- iter != bytes.end(); ++iter) {
- out << base::StringPrintf("%02X", *iter);
- }
- return out << "]";
-}
-
-} // namespace
-
BluetoothRemoteGattServiceChromeOS::BluetoothRemoteGattServiceChromeOS(
BluetoothDeviceChromeOS* device,
const dbus::ObjectPath& object_path)
@@ -165,6 +151,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,
@@ -254,29 +250,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
« 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