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