OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROMEOS_DBUS_BLUETOOTH_OUT_OF_BAND_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_BLUETOOTH_OUT_OF_BAND_CLIENT_H_ |
6 #define CHROMEOS_DBUS_BLUETOOTH_OUT_OF_BAND_CLIENT_H_ | 6 #define CHROMEOS_DBUS_BLUETOOTH_OUT_OF_BAND_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "chromeos/chromeos_export.h" | 11 #include "chromeos/chromeos_export.h" |
12 #include "chromeos/dbus/dbus_client_implementation_type.h" | 12 #include "chromeos/dbus/dbus_client_implementation_type.h" |
13 #include "dbus/object_path.h" | 13 #include "dbus/object_path.h" |
14 | 14 |
15 namespace dbus { | 15 namespace dbus { |
16 class Bus; | 16 class Bus; |
17 } // namespace dbus | 17 } // namespace dbus |
18 | 18 |
| 19 namespace device { |
| 20 struct BluetoothOutOfBandPairingData; |
| 21 } // namespace device |
| 22 |
19 namespace chromeos { | 23 namespace chromeos { |
20 | 24 |
21 struct BluetoothOutOfBandPairingData; | |
22 | |
23 // BluetoothOutOfBandClient is used to manage Out Of Band Pairing | 25 // BluetoothOutOfBandClient is used to manage Out Of Band Pairing |
24 // Data for the local adapter and remote devices. | 26 // Data for the local adapter and remote devices. |
25 class CHROMEOS_EXPORT BluetoothOutOfBandClient { | 27 class CHROMEOS_EXPORT BluetoothOutOfBandClient { |
26 public: | 28 public: |
27 virtual ~BluetoothOutOfBandClient(); | 29 virtual ~BluetoothOutOfBandClient(); |
28 | 30 |
29 typedef base::Callback<void(const BluetoothOutOfBandPairingData& data, | 31 typedef base::Callback<void( |
| 32 const device::BluetoothOutOfBandPairingData& data, |
30 bool success)> DataCallback; | 33 bool success)> DataCallback; |
31 | 34 |
32 typedef base::Callback<void(bool success)> SuccessCallback; | 35 typedef base::Callback<void(bool success)> SuccessCallback; |
33 | 36 |
34 // Reads the local Out Of Band Pairing Data and return it in |callback|. | 37 // Reads the local Out Of Band Pairing Data and return it in |callback|. |
35 virtual void ReadLocalData( | 38 virtual void ReadLocalData( |
36 const dbus::ObjectPath& object_path, | 39 const dbus::ObjectPath& object_path, |
37 const DataCallback& callback) = 0; | 40 const DataCallback& callback) = 0; |
38 | 41 |
39 // Sets the Out Of Band Pairing Data for the device at |address| to |data|, | 42 // Sets the Out Of Band Pairing Data for the device at |address| to |data|, |
40 // indicating success via |callback|. Makes a copy of |data|. | 43 // indicating success via |callback|. Makes a copy of |data|. |
41 virtual void AddRemoteData( | 44 virtual void AddRemoteData( |
42 const dbus::ObjectPath& object_path, | 45 const dbus::ObjectPath& object_path, |
43 const std::string& address, | 46 const std::string& address, |
44 const BluetoothOutOfBandPairingData& data, | 47 const device::BluetoothOutOfBandPairingData& data, |
45 const SuccessCallback& callback) = 0; | 48 const SuccessCallback& callback) = 0; |
46 | 49 |
47 // Clears the Out Of Band Pairing Data for the device at |address|, indicating | 50 // Clears the Out Of Band Pairing Data for the device at |address|, indicating |
48 // success via |callback|. | 51 // success via |callback|. |
49 virtual void RemoveRemoteData( | 52 virtual void RemoveRemoteData( |
50 const dbus::ObjectPath& object_path, | 53 const dbus::ObjectPath& object_path, |
51 const std::string& address, | 54 const std::string& address, |
52 const SuccessCallback& callback) = 0; | 55 const SuccessCallback& callback) = 0; |
53 | 56 |
54 // Creates the instance. | 57 // Creates the instance. |
55 static BluetoothOutOfBandClient* Create( | 58 static BluetoothOutOfBandClient* Create( |
56 DBusClientImplementationType type, | 59 DBusClientImplementationType type, |
57 dbus::Bus* bus); | 60 dbus::Bus* bus); |
58 | 61 |
59 protected: | 62 protected: |
60 BluetoothOutOfBandClient(); | 63 BluetoothOutOfBandClient(); |
61 | 64 |
62 private: | 65 private: |
63 DISALLOW_COPY_AND_ASSIGN(BluetoothOutOfBandClient); | 66 DISALLOW_COPY_AND_ASSIGN(BluetoothOutOfBandClient); |
64 }; | 67 }; |
65 | 68 |
66 } // namespace chromeos | 69 } // namespace chromeos |
67 | 70 |
68 #endif // CHROMEOS_DBUS_BLUETOOTH_OUT_OF_BAND_CLIENT_H_ | 71 #endif // CHROMEOS_DBUS_BLUETOOTH_OUT_OF_BAND_CLIENT_H_ |
OLD | NEW |