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

Side by Side Diff: components/proximity_auth/ble/proximity_auth_ble_system.cc

Issue 1102093002: Implementing a BLE connection finder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/proximity_auth/ble/proximity_auth_ble_system.h" 5 #include "components/proximity_auth/ble/proximity_auth_ble_system.h"
6 6
7 #include "base/bind.h"
7 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "components/proximity_auth/connection.h"
11 #include "device/bluetooth/bluetooth_device.h"
12
13 #include "components/proximity_auth/ble/bluetooth_low_energy_connection_finder.h "
msarda 2015/04/27 08:11:07 Include order should be fixed.
8 14
9 namespace proximity_auth { 15 namespace proximity_auth {
10 16
17 const char kSmartLockServiceUUID[] = "b3b7e28e-a000-3e17-bd86-6e97b9e28c11";
msarda 2015/04/27 08:11:07 This should go in an anonymous namespace.
18
19 void ConnectionCallback(
msarda 2015/04/27 08:11:07 This should go in an anonymous namespace.
20 scoped_ptr<device::BluetoothGattConnection> connection) {
21 VLOG(1) << "Connection established";
22 }
23
11 ProximityAuthBleSystem::ProximityAuthBleSystem() { 24 ProximityAuthBleSystem::ProximityAuthBleSystem() {
12 VLOG(1) << "Starting Proximity Auth over Bluetooth Low Energy."; 25 VLOG(1) << "Starting Proximity Auth over Bluetooth Low Energy.";
26 connection_finder_ = scoped_ptr<BluetoothLowEnergyConnectionFinder>(
27 new BluetoothLowEnergyConnectionFinder(kSmartLockServiceUUID));
28 connection_finder_->Find(base::Bind(&ConnectionCallback));
13 } 29 }
14 30
15 ProximityAuthBleSystem::~ProximityAuthBleSystem() { 31 ProximityAuthBleSystem::~ProximityAuthBleSystem() {
16 VLOG(1) << "Stopping Proximity over Bluetooth Low Energy."; 32 VLOG(1) << "Stopping Proximity over Bluetooth Low Energy.";
33 connection_finder_.reset();
Tim Song 2015/04/24 19:26:21 nit: you don't need explicitly call reset in the d
17 } 34 }
18 35
19 } // namespace proximity_auth 36 } // namespace proximity_auth
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698