OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_DEVICE_BLUEZ_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_DEVICE_BLUEZ_H_ |
6 #define DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_DEVICE_BLUEZ_H_ | 6 #define DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_DEVICE_BLUEZ_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // thread. | 42 // thread. |
43 class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceBlueZ | 43 class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceBlueZ |
44 : public device::BluetoothDevice, | 44 : public device::BluetoothDevice, |
45 public bluez::BluetoothGattServiceClient::Observer { | 45 public bluez::BluetoothGattServiceClient::Observer { |
46 public: | 46 public: |
47 using GetServiceRecordsCallback = | 47 using GetServiceRecordsCallback = |
48 base::Callback<void(const std::vector<BluetoothServiceRecordBlueZ>&)>; | 48 base::Callback<void(const std::vector<BluetoothServiceRecordBlueZ>&)>; |
49 using GetServiceRecordsErrorCallback = | 49 using GetServiceRecordsErrorCallback = |
50 base::Callback<void(BluetoothServiceRecordBlueZ::ErrorCode)>; | 50 base::Callback<void(BluetoothServiceRecordBlueZ::ErrorCode)>; |
51 | 51 |
| 52 ~BluetoothDeviceBlueZ() override; |
| 53 |
52 // BluetoothDevice override | 54 // BluetoothDevice override |
53 uint32_t GetBluetoothClass() const override; | 55 uint32_t GetBluetoothClass() const override; |
54 device::BluetoothTransport GetType() const override; | 56 device::BluetoothTransport GetType() const override; |
55 std::string GetAddress() const override; | 57 std::string GetAddress() const override; |
56 VendorIDSource GetVendorIDSource() const override; | 58 VendorIDSource GetVendorIDSource() const override; |
57 uint16_t GetVendorID() const override; | 59 uint16_t GetVendorID() const override; |
58 uint16_t GetProductID() const override; | 60 uint16_t GetProductID() const override; |
59 uint16_t GetDeviceID() const override; | 61 uint16_t GetDeviceID() const override; |
60 uint16_t GetAppearance() const override; | 62 uint16_t GetAppearance() const override; |
61 base::Optional<std::string> GetName() const override; | 63 base::Optional<std::string> GetName() const override; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 void DisconnectGatt() override; | 159 void DisconnectGatt() override; |
158 | 160 |
159 private: | 161 private: |
160 friend class BluetoothAdapterBlueZ; | 162 friend class BluetoothAdapterBlueZ; |
161 | 163 |
162 BluetoothDeviceBlueZ( | 164 BluetoothDeviceBlueZ( |
163 BluetoothAdapterBlueZ* adapter, | 165 BluetoothAdapterBlueZ* adapter, |
164 const dbus::ObjectPath& object_path, | 166 const dbus::ObjectPath& object_path, |
165 scoped_refptr<base::SequencedTaskRunner> ui_task_runner, | 167 scoped_refptr<base::SequencedTaskRunner> ui_task_runner, |
166 scoped_refptr<device::BluetoothSocketThread> socket_thread); | 168 scoped_refptr<device::BluetoothSocketThread> socket_thread); |
167 ~BluetoothDeviceBlueZ() override; | |
168 | 169 |
169 // bluez::BluetoothGattServiceClient::Observer overrides | 170 // bluez::BluetoothGattServiceClient::Observer overrides |
170 void GattServiceAdded(const dbus::ObjectPath& object_path) override; | 171 void GattServiceAdded(const dbus::ObjectPath& object_path) override; |
171 void GattServiceRemoved(const dbus::ObjectPath& object_path) override; | 172 void GattServiceRemoved(const dbus::ObjectPath& object_path) override; |
172 | 173 |
173 // Called once all services have been discovered. Invokes | 174 // Called once all services have been discovered. Invokes |
174 // NotifyGattDiscoveryComplete() for services for which we haven't notified | 175 // NotifyGattDiscoveryComplete() for services for which we haven't notified |
175 // before e.g. if a services is exposed during construction but services | 176 // before e.g. if a services is exposed during construction but services |
176 // haven't been resolved yet.. | 177 // haven't been resolved yet.. |
177 void UpdateGattServices(const dbus::ObjectPath& object_path); | 178 void UpdateGattServices(const dbus::ObjectPath& object_path); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 // Note: This should remain the last member so it'll be destroyed and | 275 // Note: This should remain the last member so it'll be destroyed and |
275 // invalidate its weak pointers before any other members are destroyed. | 276 // invalidate its weak pointers before any other members are destroyed. |
276 base::WeakPtrFactory<BluetoothDeviceBlueZ> weak_ptr_factory_; | 277 base::WeakPtrFactory<BluetoothDeviceBlueZ> weak_ptr_factory_; |
277 | 278 |
278 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceBlueZ); | 279 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceBlueZ); |
279 }; | 280 }; |
280 | 281 |
281 } // namespace bluez | 282 } // namespace bluez |
282 | 283 |
283 #endif // DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_DEVICE_BLUEZ_H_ | 284 #endif // DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_DEVICE_BLUEZ_H_ |
OLD | NEW |