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

Side by Side 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: Using the right UUID Created 3 years, 7 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
OLDNEW
(Empty)
1 // Copyright 2015 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 #include "components/proximity_auth/bluetooth_low_energy_setup_connection_finder .h"
6
7 #include <string>
8
9 #include "base/memory/ptr_util.h"
10 #include "components/cryptauth/ble/bluetooth_low_energy_weave_client_connection. h"
11 #include "components/cryptauth/bluetooth_throttler.h"
12 #include "components/cryptauth/connection.h"
13 #include "components/proximity_auth/logging/logging.h"
14 #include "device/bluetooth/bluetooth_device.h"
15 #include "device/bluetooth/bluetooth_uuid.h"
16
17 using device::BluetoothDevice;
18
19 namespace proximity_auth {
20
21 BluetoothLowEnergySetupConnectionFinder::
22 BluetoothLowEnergySetupConnectionFinder(
23 const std::string& remote_service_uuid,
24 cryptauth::BluetoothThrottler* bluetooth_throttler)
25 : BluetoothLowEnergyConnectionFinder(
26 cryptauth::RemoteDevice(),
27 remote_service_uuid,
28 std::vector<cryptauth::BeaconSeed>(),
29 base::MakeUnique<cryptauth::BackgroundEidGenerator>(),
30 bluetooth_throttler),
31 remote_service_uuid_(device::BluetoothUUID(remote_service_uuid)) {}
32
33 bool BluetoothLowEnergySetupConnectionFinder::IsRightDevice(
34 BluetoothDevice* device) {
35 if (!device)
36 return false;
37
38 BluetoothDevice::UUIDSet uuids = device->GetUUIDs();
39 PA_LOG(INFO) << "Device " << device->GetAddress() << " has " << uuids.size()
40 << " services.";
41 return base::ContainsKey(uuids, remote_service_uuid_);
42 }
43
44 } // namespace proximity_auth
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698