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 "device/bluetooth/bluez/bluetooth_remote_gatt_characteristic_bluez.h" | 5 #include "device/bluetooth/bluez/bluetooth_remote_gatt_characteristic_bluez.h" |
6 | 6 |
7 #include <iterator> | 7 #include <iterator> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 out << base::StringPrintf("%02X", *iter); | 35 out << base::StringPrintf("%02X", *iter); |
36 } | 36 } |
37 return out << "]"; | 37 return out << "]"; |
38 } | 38 } |
39 | 39 |
40 } // namespace | 40 } // namespace |
41 | 41 |
42 BluetoothRemoteGattCharacteristicBlueZ::BluetoothRemoteGattCharacteristicBlueZ( | 42 BluetoothRemoteGattCharacteristicBlueZ::BluetoothRemoteGattCharacteristicBlueZ( |
43 BluetoothRemoteGattServiceBlueZ* service, | 43 BluetoothRemoteGattServiceBlueZ* service, |
44 const dbus::ObjectPath& object_path) | 44 const dbus::ObjectPath& object_path) |
45 : BluetoothGattCharacteristicBlueZ(object_path), | 45 : num_notify_sessions_(0), |
46 num_notify_sessions_(0), | |
47 notify_call_pending_(false), | 46 notify_call_pending_(false), |
48 service_(service), | 47 service_(service), |
49 weak_ptr_factory_(this) { | 48 weak_ptr_factory_(this) { |
| 49 object_path_ = object_path; |
50 VLOG(1) << "Creating remote GATT characteristic with identifier: " | 50 VLOG(1) << "Creating remote GATT characteristic with identifier: " |
51 << GetIdentifier() << ", UUID: " << GetUUID().canonical_value(); | 51 << GetIdentifier() << ", UUID: " << GetUUID().canonical_value(); |
52 bluez::BluezDBusManager::Get() | 52 bluez::BluezDBusManager::Get() |
53 ->GetBluetoothGattDescriptorClient() | 53 ->GetBluetoothGattDescriptorClient() |
54 ->AddObserver(this); | 54 ->AddObserver(this); |
55 | 55 |
56 // Add all known GATT characteristic descriptors. | 56 // Add all known GATT characteristic descriptors. |
57 const std::vector<dbus::ObjectPath>& gatt_descs = | 57 const std::vector<dbus::ObjectPath>& gatt_descs = |
58 bluez::BluezDBusManager::Get() | 58 bluez::BluezDBusManager::Get() |
59 ->GetBluetoothGattDescriptorClient() | 59 ->GetBluetoothGattDescriptorClient() |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 const ErrorCallback& error_callback, | 456 const ErrorCallback& error_callback, |
457 const std::string& error_name, | 457 const std::string& error_name, |
458 const std::string& error_message) { | 458 const std::string& error_message) { |
459 VLOG(1) << "Operation failed: " << error_name | 459 VLOG(1) << "Operation failed: " << error_name |
460 << ", message: " << error_message; | 460 << ", message: " << error_message; |
461 error_callback.Run( | 461 error_callback.Run( |
462 BluetoothGattServiceBlueZ::DBusErrorToServiceError(error_name)); | 462 BluetoothGattServiceBlueZ::DBusErrorToServiceError(error_name)); |
463 } | 463 } |
464 | 464 |
465 } // namespace bluez | 465 } // namespace bluez |
OLD | NEW |