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

Unified Diff: components/proximity_auth/bluetooth_low_energy_setup_connection_finder.cc

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
« no previous file with comments | « components/proximity_auth/bluetooth_low_energy_setup_connection_finder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/proximity_auth/bluetooth_low_energy_setup_connection_finder.cc
diff --git a/components/proximity_auth/bluetooth_low_energy_setup_connection_finder.cc b/components/proximity_auth/bluetooth_low_energy_setup_connection_finder.cc
new file mode 100644
index 0000000000000000000000000000000000000000..96617c5a077cc96f20f32e930f41a29724a8d74e
--- /dev/null
+++ b/components/proximity_auth/bluetooth_low_energy_setup_connection_finder.cc
@@ -0,0 +1,44 @@
+// 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.
+
+#include "components/proximity_auth/bluetooth_low_energy_setup_connection_finder.h"
+
+#include <string>
+
+#include "base/memory/ptr_util.h"
+#include "components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.h"
+#include "components/cryptauth/bluetooth_throttler.h"
+#include "components/cryptauth/connection.h"
+#include "components/proximity_auth/logging/logging.h"
+#include "device/bluetooth/bluetooth_device.h"
+#include "device/bluetooth/bluetooth_uuid.h"
+
+using device::BluetoothDevice;
+
+namespace proximity_auth {
+
+BluetoothLowEnergySetupConnectionFinder::
+ BluetoothLowEnergySetupConnectionFinder(
+ const std::string& remote_service_uuid,
+ cryptauth::BluetoothThrottler* bluetooth_throttler)
+ : BluetoothLowEnergyConnectionFinder(
+ cryptauth::RemoteDevice(),
+ remote_service_uuid,
+ std::vector<cryptauth::BeaconSeed>(),
+ base::MakeUnique<cryptauth::BackgroundEidGenerator>(),
+ bluetooth_throttler),
+ remote_service_uuid_(device::BluetoothUUID(remote_service_uuid)) {}
+
+bool BluetoothLowEnergySetupConnectionFinder::IsRightDevice(
+ BluetoothDevice* device) {
+ if (!device)
+ return false;
+
+ BluetoothDevice::UUIDSet uuids = device->GetUUIDs();
+ PA_LOG(INFO) << "Device " << device->GetAddress() << " has " << uuids.size()
+ << " services.";
+ return base::ContainsKey(uuids, remote_service_uuid_);
+}
+
+} // namespace proximity_auth
« no previous file with comments | « components/proximity_auth/bluetooth_low_energy_setup_connection_finder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698