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

Side by Side Diff: device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc

Issue 346743002: device/bluetooth: Send GattServiceChanged event for new Chrc. properties. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simple rebase 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « device/bluetooth/bluetooth_remote_gatt_service_chromeos.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/bluetooth/bluetooth_remote_gatt_service_chromeos.h" 5 #include "device/bluetooth/bluetooth_remote_gatt_service_chromeos.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "chromeos/dbus/bluetooth_gatt_service_client.h" 9 #include "chromeos/dbus/bluetooth_gatt_service_client.h"
10 #include "chromeos/dbus/dbus_thread_manager.h" 10 #include "chromeos/dbus/dbus_thread_manager.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 DCHECK(characteristic->object_path() == object_path); 243 DCHECK(characteristic->object_path() == object_path);
244 characteristics_.erase(iter); 244 characteristics_.erase(iter);
245 245
246 FOR_EACH_OBSERVER(device::BluetoothGattService::Observer, observers_, 246 FOR_EACH_OBSERVER(device::BluetoothGattService::Observer, observers_,
247 GattCharacteristicRemoved(this, characteristic)); 247 GattCharacteristicRemoved(this, characteristic));
248 NotifyServiceChanged(); 248 NotifyServiceChanged();
249 249
250 delete characteristic; 250 delete characteristic;
251 } 251 }
252 252
253 void BluetoothRemoteGattServiceChromeOS::GattCharacteristicPropertyChanged(
254 const dbus::ObjectPath& object_path,
255 const std::string& property_name) {
256 if (characteristics_.find(object_path) == characteristics_.end()) {
257 VLOG(2) << "Properties of unknown characteristic changed";
258 return;
259 }
260
261 // We may receive a property changed event in certain cases, e.g. when the
262 // characteristic "Flags" property has been updated with values from the
263 // "Characteristic Extended Properties" descriptor. In this case, kick off
264 // a service changed observer event to let observers refresh the
265 // characteristics.
266 BluetoothGattCharacteristicClient::Properties* properties =
267 DBusThreadManager::Get()->GetBluetoothGattCharacteristicClient()->
268 GetProperties(object_path);
269 DCHECK(properties);
270 if (property_name != properties->flags.name())
271 return;
272
273 NotifyServiceChanged();
274 }
275
253 } // namespace chromeos 276 } // namespace chromeos
OLDNEW
« 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