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

Unified 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: review comments 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 side-by-side diff with in-line comments
Download patch
Index: chromeos/dbus/bluetooth_out_of_band_client.h
diff --git a/chromeos/dbus/bluetooth_out_of_band_client.h b/chromeos/dbus/bluetooth_out_of_band_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..858ce895c714ff9dcd5ca303ffb632212e5d3f6a
--- /dev/null
+++ b/chromeos/dbus/bluetooth_out_of_band_client.h
@@ -0,0 +1,77 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_DBUS_BLUETOOTH_OUT_OF_BAND_CLIENT_H_
+#define CHROMEOS_DBUS_BLUETOOTH_OUT_OF_BAND_CLIENT_H_
+#pragma once
+
+#include <string>
+
+#include "base/callback.h"
+#include "chromeos/chromeos_export.h"
+#include "chromeos/dbus/dbus_client_implementation_type.h"
+#include "dbus/object_path.h"
+
+namespace dbus {
+class Bus;
+} // namespace dbus
+
+namespace chromeos {
+
+static const size_t kBluetoothOutOfBandPairingDataSize = 16;
satorux1 2012/06/14 16:07:55 please omit static. From the spec: Objects decla
bryeung 2012/06/14 17:56:04 Done.
+
+struct BluetoothOutOfBandPairingData {
satorux1 2012/06/14 16:07:55 Could you write some comment about the struct?
bryeung 2012/06/14 17:56:04 Done.
+ // Simple Pairing Hash C
satorux1 2012/06/14 16:07:55 nit: period is missing.
bryeung 2012/06/14 17:56:04 Seems a bit weird, considering it isn't really a s
+ uint8_t hash[kBluetoothOutOfBandPairingDataSize];
+
+ // Simple Pairing Randomizer R
satorux1 2012/06/14 16:07:55 ditto
bryeung 2012/06/14 17:56:04 Done.
+ uint8_t randomizer[kBluetoothOutOfBandPairingDataSize];
+};
+
+// BluetoothOutOfBandClient is used to manage Out Of Band Pairing
+// Data for the local adapter and remote devices.
+class CHROMEOS_EXPORT BluetoothOutOfBandClient {
+ public:
+ virtual ~BluetoothOutOfBandClient();
+
+ typedef base::Callback<void(const BluetoothOutOfBandPairingData& data,
+ bool success)> DataCallback;
+
+ typedef base::Callback<void(bool success)> SuccessCallback;
+
+ // Read the local Out Of Band Pairing Data and return it in |callback|.
satorux1 2012/06/14 16:07:55 Reads
bryeung 2012/06/14 17:56:04 Done.
+ virtual void ReadLocalData(
+ const dbus::ObjectPath& object_path,
+ const DataCallback& callback) = 0;
+
+ // Set the Out Of Band Pairing Data for the device at |address| to |data|,
satorux1 2012/06/14 16:07:55 Sets. Please fix other places too.
bryeung 2012/06/14 17:56:04 Done.
+ // indicating success via |callback|. Makes a copy of |data|.
+ virtual void AddRemoteData(
+ const dbus::ObjectPath& object_path,
+ const std::string& address,
+ const BluetoothOutOfBandPairingData& data,
+ const SuccessCallback& callback) = 0;
+
+ // Clear the Out Of Band Pairing Data for the device at |address|, indicating
+ // success via |callback|.
+ virtual void RemoveRemoteData(
+ const dbus::ObjectPath& object_path,
+ const std::string& address,
+ const SuccessCallback& callback) = 0;
+
+ // Creates the instance.
+ static BluetoothOutOfBandClient* Create(
+ DBusClientImplementationType type,
+ dbus::Bus* bus);
+
+ protected:
+ BluetoothOutOfBandClient();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BluetoothOutOfBandClient);
+};
+
+} // namespace chromeos
+
+#endif // CHROMEOS_DBUS_BLUETOOTH_OUT_OF_BAND_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698