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

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: updated test code 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
« no previous file with comments | « device/bluetooth/bluez/bluetooth_remote_gatt_characteristic_bluez.cc ('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 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 DCHECK_GE(iter->second->num_of_characteristic_value_read_in_progress_, 0);
248 iter->second, properties->value.value()); 248 if (iter->second->num_of_characteristic_value_read_in_progress_ > 0) {
249 --iter->second->num_of_characteristic_value_read_in_progress_;
250 } else {
251 GetAdapter()->NotifyGattCharacteristicValueChanged(
252 iter->second, properties->value.value());
253 }
254 }
249 } 255 }
250 256
251 } // namespace bluez 257 } // namespace bluez
OLDNEW
« no previous file with comments | « device/bluetooth/bluez/bluetooth_remote_gatt_characteristic_bluez.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698