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

Unified 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 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
index b4f20e44dcb0ad5d0cfdfe0c2c19b69494eb7ee1..ecdb90d05ef6655348ee361d1934c2e2360326cb 100644
--- a/components/proximity_auth/ble/proximity_auth_ble_system.cc
+++ b/components/proximity_auth/ble/proximity_auth_ble_system.cc
@@ -4,16 +4,33 @@
#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"
msarda 2015/04/27 08:11:07 Include order should be fixed.
namespace proximity_auth {
+const char kSmartLockServiceUUID[] = "b3b7e28e-a000-3e17-bd86-6e97b9e28c11";
msarda 2015/04/27 08:11:07 This should go in an anonymous namespace.
+
+void ConnectionCallback(
msarda 2015/04/27 08:11:07 This should go in an anonymous namespace.
+ scoped_ptr<device::BluetoothGattConnection> connection) {
+ VLOG(1) << "Connection established";
+}
+
ProximityAuthBleSystem::ProximityAuthBleSystem() {
VLOG(1) << "Starting Proximity Auth over Bluetooth Low Energy.";
+ connection_finder_ = scoped_ptr<BluetoothLowEnergyConnectionFinder>(
+ new BluetoothLowEnergyConnectionFinder(kSmartLockServiceUUID));
+ connection_finder_->Find(base::Bind(&ConnectionCallback));
}
ProximityAuthBleSystem::~ProximityAuthBleSystem() {
VLOG(1) << "Stopping Proximity over Bluetooth Low Energy.";
+ connection_finder_.reset();
Tim Song 2015/04/24 19:26:21 nit: you don't need explicitly call reset in the d
}
} // namespace proximity_auth

Powered by Google App Engine
This is Rietveld 408576698