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_descriptor_bluez.h" | 5 #include "device/bluetooth/bluez/bluetooth_remote_gatt_descriptor_bluez.h" |
6 | 6 |
7 #include <iterator> | 7 #include <iterator> |
8 #include <ostream> | 8 #include <ostream> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 out << base::StringPrintf("%02X", *iter); | 32 out << base::StringPrintf("%02X", *iter); |
33 } | 33 } |
34 return out << "]"; | 34 return out << "]"; |
35 } | 35 } |
36 | 36 |
37 } // namespace | 37 } // namespace |
38 | 38 |
39 BluetoothRemoteGattDescriptorBlueZ::BluetoothRemoteGattDescriptorBlueZ( | 39 BluetoothRemoteGattDescriptorBlueZ::BluetoothRemoteGattDescriptorBlueZ( |
40 BluetoothRemoteGattCharacteristicBlueZ* characteristic, | 40 BluetoothRemoteGattCharacteristicBlueZ* characteristic, |
41 const dbus::ObjectPath& object_path) | 41 const dbus::ObjectPath& object_path) |
42 : BluetoothGattDescriptorBlueZ(object_path), | 42 : characteristic_(characteristic), weak_ptr_factory_(this) { |
43 characteristic_(characteristic), | 43 object_path_ = object_path; |
44 weak_ptr_factory_(this) { | |
45 VLOG(1) << "Creating remote GATT descriptor with identifier: " | 44 VLOG(1) << "Creating remote GATT descriptor with identifier: " |
46 << GetIdentifier() << ", UUID: " << GetUUID().canonical_value(); | 45 << GetIdentifier() << ", UUID: " << GetUUID().canonical_value(); |
47 } | 46 } |
48 | 47 |
49 BluetoothRemoteGattDescriptorBlueZ::~BluetoothRemoteGattDescriptorBlueZ() {} | 48 BluetoothRemoteGattDescriptorBlueZ::~BluetoothRemoteGattDescriptorBlueZ() {} |
50 | 49 |
51 device::BluetoothUUID BluetoothRemoteGattDescriptorBlueZ::GetUUID() const { | 50 device::BluetoothUUID BluetoothRemoteGattDescriptorBlueZ::GetUUID() const { |
52 bluez::BluetoothGattDescriptorClient::Properties* properties = | 51 bluez::BluetoothGattDescriptorClient::Properties* properties = |
53 bluez::BluezDBusManager::Get() | 52 bluez::BluezDBusManager::Get() |
54 ->GetBluetoothGattDescriptorClient() | 53 ->GetBluetoothGattDescriptorClient() |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 const std::string& error_name, | 114 const std::string& error_name, |
116 const std::string& error_message) { | 115 const std::string& error_message) { |
117 VLOG(1) << "Operation failed: " << error_name | 116 VLOG(1) << "Operation failed: " << error_name |
118 << ", message: " << error_message; | 117 << ", message: " << error_message; |
119 | 118 |
120 error_callback.Run( | 119 error_callback.Run( |
121 BluetoothGattServiceBlueZ::DBusErrorToServiceError(error_name)); | 120 BluetoothGattServiceBlueZ::DBusErrorToServiceError(error_name)); |
122 } | 121 } |
123 | 122 |
124 } // namespace bluez | 123 } // namespace bluez |
OLD | NEW |