Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: chromeos/dbus/bluetooth_out_of_band_client.h

Issue 10546010: Implement support for the OOB Pairing APIs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: refactor to create BluetoothOutOfBandClient Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 #pragma once
8
9 #include <string>
10
11 #include "base/callback.h"
12 #include "chromeos/chromeos_export.h"
13 #include "chromeos/dbus/dbus_client_implementation_type.h"
14 #include "dbus/object_path.h"
15
16 namespace dbus {
17 class Bus;
18 } // namespace dbus
19
20 namespace chromeos {
21
22 static const size_t kBluetoothOutOfBandPairingDataSize = 16;
23
24 struct BluetoothOutOfBandPairingData {
25 // Simple Pairing Hash C
26 uint8_t hash[kBluetoothOutOfBandPairingDataSize];
27
28 // Simple Pairing Randomizer R
29 uint8_t randomizer[kBluetoothOutOfBandPairingDataSize];
30 };
31
32 // BluetoothOutOfBandClient is used to manage Out Of Band Pairing
33 // Data for the local adapter and remote devices.
34 class CHROMEOS_EXPORT BluetoothOutOfBandClient {
35 public:
36 virtual ~BluetoothOutOfBandClient();
37
38 typedef base::Callback<void(const BluetoothOutOfBandPairingData& data,
39 bool success)> DataCallback;
40
41 typedef base::Callback<void(bool success)> SuccessCallback;
42
43 // Read the local Out Of Band Pairing Data and return it in |callback|.
44 virtual void ReadLocalData(
45 const dbus::ObjectPath& object_path,
46 const DataCallback& callback) = 0;
47
48 // Set the Out Of Band Pairing Data for the device at |address| to |data|,
49 // indicating success via |callback|. Makes a copy of |data|.
50 virtual void AddRemoteData(
51 const dbus::ObjectPath& object_path,
52 const std::string& address,
53 const BluetoothOutOfBandPairingData& data,
54 const SuccessCallback& callback) = 0;
55
56 // Clear the Out Of Band Pairing Data for the device at |address|, indicating
57 // success via |callback|.
58 virtual void RemoveRemoteData(
59 const dbus::ObjectPath& object_path,
60 const std::string& address,
61 const SuccessCallback& callback) = 0;
62
63 // Creates the instance.
64 static BluetoothOutOfBandClient* Create(
65 DBusClientImplementationType type,
66 dbus::Bus* bus);
67
68 protected:
69 BluetoothOutOfBandClient();
70
71 private:
72 DISALLOW_COPY_AND_ASSIGN(BluetoothOutOfBandClient);
73 };
74
75 } // namespace chromeos
76
77 #endif // CHROMEOS_DBUS_BLUETOOTH_OUT_OF_BAND_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698