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

Unified Diff: components/proximity_auth/ble/proximity_auth_ble_system.cc

Issue 1094273003: 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 side-by-side diff with in-line comments
Download patch
Index: components/proximity_auth/ble/proximity_auth_ble_system.cc
diff --git a/components/proximity_auth/ble/proximity_auth_ble_system.cc b/components/proximity_auth/ble/proximity_auth_ble_system.cc
new file mode 100644
index 0000000000000000000000000000000000000000..93240f0d9a9ed860a5c8e923beb64d3c92e9d209
--- /dev/null
+++ b/components/proximity_auth/ble/proximity_auth_ble_system.cc
@@ -0,0 +1,36 @@
+// Copyright 2015 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/ble/proximity_auth_ble_system.h"
+
+#include "base/bind.h"
+#include "base/logging.h"
+#include "base/memory/scoped_ptr.h"
+#include "components/proximity_auth/connection.h"
+#include "device/bluetooth/bluetooth_device.h"
+
+#include "components/proximity_auth/ble/bluetooth_low_energy_connection_finder.h"
+
+namespace proximity_auth {
+
+const std::string kSmartLockServiceUUID =
+ "b3b7e28e-a000-3e17-bd86-6e97b9e28c11";
+
+void ConnectionCallback(
+ scoped_ptr<device::BluetoothGattConnection> connection) {
+ DVLOG(1) << "Connection established";
+}
+
+ProximityAuthBleSystem::ProximityAuthBleSystem() {
+ DVLOG(1) << "Starting Proximity Auth over Bluetooth Low Energy.";
+ BluetoothLowEnergyConnectionFinder* connection_finder =
+ new BluetoothLowEnergyConnectionFinder(kSmartLockServiceUUID);
+ connection_finder->Find(base::Bind(&ConnectionCallback));
+}
+
+ProximityAuthBleSystem::~ProximityAuthBleSystem() {
+ DVLOG(1) << "Stopping Proximity over Bluetooth Low Energy.";
+}
+
+} // proximity_auth

Powered by Google App Engine
This is Rietveld 408576698