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/bluez/bluetooth_remote_gatt_service_bluez.cc

Issue 2728623004: Fix getting notified twice after subscribe to notifications and call readValue (Closed)
Patch Set: address comments Created 3 years, 9 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <iterator> 5 #include <iterator>
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "dbus/property.h" 8 #include "dbus/property.h"
9 #include "device/bluetooth/bluez/bluetooth_adapter_bluez.h" 9 #include "device/bluetooth/bluez/bluetooth_adapter_bluez.h"
10 #include "device/bluetooth/bluez/bluetooth_device_bluez.h" 10 #include "device/bluetooth/bluez/bluetooth_device_bluez.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 bluez::BluetoothGattCharacteristicClient::Properties* properties = 236 bluez::BluetoothGattCharacteristicClient::Properties* properties =
237 bluez::BluezDBusManager::Get() 237 bluez::BluezDBusManager::Get()
238 ->GetBluetoothGattCharacteristicClient() 238 ->GetBluetoothGattCharacteristicClient()
239 ->GetProperties(object_path); 239 ->GetProperties(object_path);
240 240
241 DCHECK(properties); 241 DCHECK(properties);
242 DCHECK(GetAdapter()); 242 DCHECK(GetAdapter());
243 243
244 if (property_name == properties->flags.name()) 244 if (property_name == properties->flags.name())
245 NotifyServiceChanged(); 245 NotifyServiceChanged();
246 else if (property_name == properties->value.name()) 246 else if (property_name == properties->value.name()) {
247 GetAdapter()->NotifyGattCharacteristicValueChanged( 247 if (iter->second->characteristic_value_read_in_progress()) {
248 iter->second, properties->value.value()); 248 iter->second->set_characteristic_value_read_in_progress(false);
249 } else {
250 GetAdapter()->NotifyGattCharacteristicValueChanged(
251 iter->second, properties->value.value());
252 }
253 }
249 } 254 }
250 255
251 } // namespace bluez 256 } // namespace bluez
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698