OLD | NEW |
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 Loading... |
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 |
OLD | NEW |