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_ADAPTER_BLUEZ_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_ADAPTER_BLUEZ_H_ |
6 #define DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_ADAPTER_BLUEZ_H_ | 6 #define DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_ADAPTER_BLUEZ_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <memory> | 11 #include <memory> |
12 #include <queue> | 12 #include <queue> |
13 #include <string> | 13 #include <string> |
14 #include <tuple> | 14 #include <tuple> |
15 #include <utility> | 15 #include <utility> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "base/macros.h" | 18 #include "base/macros.h" |
19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
20 #include "dbus/object_path.h" | 20 #include "dbus/object_path.h" |
21 #include "device/bluetooth/bluetooth_adapter.h" | 21 #include "device/bluetooth/bluetooth_adapter.h" |
22 #include "device/bluetooth/bluetooth_audio_sink.h" | |
23 #include "device/bluetooth/bluetooth_device.h" | 22 #include "device/bluetooth/bluetooth_device.h" |
24 #include "device/bluetooth/bluetooth_discovery_session.h" | 23 #include "device/bluetooth/bluetooth_discovery_session.h" |
25 #include "device/bluetooth/bluetooth_export.h" | 24 #include "device/bluetooth/bluetooth_export.h" |
26 #include "device/bluetooth/bluetooth_gatt_service.h" | 25 #include "device/bluetooth/bluetooth_gatt_service.h" |
27 #include "device/bluetooth/bluez/bluetooth_service_record_bluez.h" | 26 #include "device/bluetooth/bluez/bluetooth_service_record_bluez.h" |
28 #include "device/bluetooth/dbus/bluetooth_adapter_client.h" | 27 #include "device/bluetooth/dbus/bluetooth_adapter_client.h" |
29 #include "device/bluetooth/dbus/bluetooth_agent_service_provider.h" | 28 #include "device/bluetooth/dbus/bluetooth_agent_service_provider.h" |
30 #include "device/bluetooth/dbus/bluetooth_device_client.h" | 29 #include "device/bluetooth/dbus/bluetooth_device_client.h" |
31 #include "device/bluetooth/dbus/bluetooth_input_client.h" | 30 #include "device/bluetooth/dbus/bluetooth_input_client.h" |
32 #include "device/bluetooth/dbus/bluetooth_profile_manager_client.h" | 31 #include "device/bluetooth/dbus/bluetooth_profile_manager_client.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 void CreateRfcommService( | 108 void CreateRfcommService( |
110 const device::BluetoothUUID& uuid, | 109 const device::BluetoothUUID& uuid, |
111 const ServiceOptions& options, | 110 const ServiceOptions& options, |
112 const CreateServiceCallback& callback, | 111 const CreateServiceCallback& callback, |
113 const CreateServiceErrorCallback& error_callback) override; | 112 const CreateServiceErrorCallback& error_callback) override; |
114 void CreateL2capService( | 113 void CreateL2capService( |
115 const device::BluetoothUUID& uuid, | 114 const device::BluetoothUUID& uuid, |
116 const ServiceOptions& options, | 115 const ServiceOptions& options, |
117 const CreateServiceCallback& callback, | 116 const CreateServiceCallback& callback, |
118 const CreateServiceErrorCallback& error_callback) override; | 117 const CreateServiceErrorCallback& error_callback) override; |
119 void RegisterAudioSink( | |
120 const device::BluetoothAudioSink::Options& options, | |
121 const device::BluetoothAdapter::AcquiredCallback& callback, | |
122 const device::BluetoothAudioSink::ErrorCallback& error_callback) override; | |
123 | 118 |
124 void RegisterAdvertisement( | 119 void RegisterAdvertisement( |
125 std::unique_ptr<device::BluetoothAdvertisement::Data> advertisement_data, | 120 std::unique_ptr<device::BluetoothAdvertisement::Data> advertisement_data, |
126 const CreateAdvertisementCallback& callback, | 121 const CreateAdvertisementCallback& callback, |
127 const AdvertisementErrorCallback& error_callback) override; | 122 const AdvertisementErrorCallback& error_callback) override; |
128 | 123 |
129 void SetAdvertisingInterval( | 124 void SetAdvertisingInterval( |
130 const base::TimeDelta& min, | 125 const base::TimeDelta& min, |
131 const base::TimeDelta& max, | 126 const base::TimeDelta& max, |
132 const base::Closure& callback, | 127 const base::Closure& callback, |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 void OnRegisterAgent(); | 285 void OnRegisterAgent(); |
291 void OnRegisterAgentError(const std::string& error_name, | 286 void OnRegisterAgentError(const std::string& error_name, |
292 const std::string& error_message); | 287 const std::string& error_message); |
293 | 288 |
294 // Called by dbus:: on completion of the D-Bus method call to request that | 289 // Called by dbus:: on completion of the D-Bus method call to request that |
295 // the pairing agent be made the default. | 290 // the pairing agent be made the default. |
296 void OnRequestDefaultAgent(); | 291 void OnRequestDefaultAgent(); |
297 void OnRequestDefaultAgentError(const std::string& error_name, | 292 void OnRequestDefaultAgentError(const std::string& error_name, |
298 const std::string& error_message); | 293 const std::string& error_message); |
299 | 294 |
300 // Called by BluetoothAudioSinkBlueZ on completion of registering an audio | |
301 // sink. | |
302 void OnRegisterAudioSink( | |
303 const device::BluetoothAdapter::AcquiredCallback& callback, | |
304 const device::BluetoothAudioSink::ErrorCallback& error_callback, | |
305 scoped_refptr<device::BluetoothAudioSink> audio_sink); | |
306 | |
307 // Internal method to obtain a BluetoothPairingBlueZ object for the device | 295 // Internal method to obtain a BluetoothPairingBlueZ object for the device |
308 // with path |object_path|. Returns the existing pairing object if the device | 296 // with path |object_path|. Returns the existing pairing object if the device |
309 // already has one (usually an outgoing connection in progress) or a new | 297 // already has one (usually an outgoing connection in progress) or a new |
310 // pairing object with the default pairing delegate if not. If no default | 298 // pairing object with the default pairing delegate if not. If no default |
311 // pairing object exists, NULL will be returned. | 299 // pairing object exists, NULL will be returned. |
312 BluetoothPairingBlueZ* GetPairing(const dbus::ObjectPath& object_path); | 300 BluetoothPairingBlueZ* GetPairing(const dbus::ObjectPath& object_path); |
313 | 301 |
314 // Set the tracked adapter to the one in |object_path|, this object will | 302 // Set the tracked adapter to the one in |object_path|, this object will |
315 // subsequently operate on that adapter until it is removed. | 303 // subsequently operate on that adapter until it is removed. |
316 void SetAdapter(const dbus::ObjectPath& object_path); | 304 void SetAdapter(const dbus::ObjectPath& object_path); |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 // Note: This should remain the last member so it'll be destroyed and | 490 // Note: This should remain the last member so it'll be destroyed and |
503 // invalidate its weak pointers before any other members are destroyed. | 491 // invalidate its weak pointers before any other members are destroyed. |
504 base::WeakPtrFactory<BluetoothAdapterBlueZ> weak_ptr_factory_; | 492 base::WeakPtrFactory<BluetoothAdapterBlueZ> weak_ptr_factory_; |
505 | 493 |
506 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterBlueZ); | 494 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterBlueZ); |
507 }; | 495 }; |
508 | 496 |
509 } // namespace bluez | 497 } // namespace bluez |
510 | 498 |
511 #endif // DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_ADAPTER_BLUEZ_H_ | 499 #endif // DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_ADAPTER_BLUEZ_H_ |
OLD | NEW |