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

Unified Diff: components/proximity_auth/bluetooth_low_energy_setup_connection_finder.h

Issue 2849493002: [EasyUnlock] Fixing the setup connection finder and message format. (Closed)
Patch Set: date Created 3 years, 8 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: components/proximity_auth/bluetooth_low_energy_setup_connection_finder.h
diff --git a/components/proximity_auth/bluetooth_low_energy_setup_connection_finder.h b/components/proximity_auth/bluetooth_low_energy_setup_connection_finder.h
new file mode 100644
index 0000000000000000000000000000000000000000..0c2d3f31903a729fa87256a1b25a8f02754c1b1a
--- /dev/null
+++ b/components/proximity_auth/bluetooth_low_energy_setup_connection_finder.h
@@ -0,0 +1,46 @@
+// Copyright 2017 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 COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_SETUP_CONNECTION_FINDER_H
+#define COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_SETUP_CONNECTION_FINDER_H
+
+#include <string>
+
+#include "base/macros.h"
+#include "components/cryptauth/bluetooth_throttler.h"
+#include "components/cryptauth/remote_device.h"
+#include "components/proximity_auth/bluetooth_low_energy_connection_finder.h"
+#include "device/bluetooth/bluetooth_device.h"
+
+namespace proximity_auth {
+
+// This cryptauth::ConnectionFinder implementation is specialized in finding a
+// Bluetooth Low Energy remote device based on the advertised service UUID.
+class BluetoothLowEnergySetupConnectionFinder
+ : public BluetoothLowEnergyConnectionFinder {
+ public:
+ // Finds (and connects) to a Bluetooth low energy device, based on the UUID
+ // advertised by the remote device.
+ //
+ // |remote_service_uuid|: The UUID of the service used to send/receive data in
+ // remote device.
+ // |bluetooth_throttler|: The reconnection throttler.
+ BluetoothLowEnergySetupConnectionFinder(
+ const std::string& remote_service_uuid,
+ cryptauth::BluetoothThrottler* bluetooth_throttler);
+
+ private:
+ // Checks if |device| is the right device, that is is adversing tthe right
+ // service UUID.
+ bool IsRightDevice(device::BluetoothDevice* device) override;
+
+ // The UUID of the service advertised by the remote device.
+ device::BluetoothUUID remote_service_uuid_;
+
+ DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergySetupConnectionFinder);
+};
+
+} // namespace proximity_auth
+
+#endif // COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_SETUP_CONNECTION_FINDER_H

Powered by Google App Engine
This is Rietveld 408576698