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

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

Issue 1144333007: Adding unit tests for BLE connection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing compilation on OS X and Windows 2 Created 5 years, 6 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/bluetooth_low_energy_characteristics_fin der.h" 5 #include "components/proximity_auth/ble/bluetooth_low_energy_characteristics_fin der.h"
6 6
7 #include "device/bluetooth/bluetooth_adapter.h" 7 #include "device/bluetooth/bluetooth_adapter.h"
8 #include "device/bluetooth/bluetooth_device.h" 8 #include "device/bluetooth/bluetooth_device.h"
9 #include "device/bluetooth/bluetooth_gatt_characteristic.h" 9 #include "device/bluetooth/bluetooth_gatt_characteristic.h"
10 #include "device/bluetooth/bluetooth_uuid.h" 10 #include "device/bluetooth/bluetooth_uuid.h"
(...skipping 27 matching lines...) Expand all
38 return; 38 return;
39 } 39 }
40 40
41 adapter_->AddObserver(this); 41 adapter_->AddObserver(this);
42 ScanRemoteCharacteristics(device, remote_service_.uuid); 42 ScanRemoteCharacteristics(device, remote_service_.uuid);
43 43
44 // TODO(sacomoto): implement a timeout for characteristic discovery. 44 // TODO(sacomoto): implement a timeout for characteristic discovery.
45 } 45 }
46 46
47 BluetoothLowEnergyCharacteristicsFinder:: 47 BluetoothLowEnergyCharacteristicsFinder::
48 BluetoothLowEnergyCharacteristicsFinder() {
49 }
50
51 BluetoothLowEnergyCharacteristicsFinder::
48 ~BluetoothLowEnergyCharacteristicsFinder() { 52 ~BluetoothLowEnergyCharacteristicsFinder() {
49 ResetCallbacks(); 53 ResetCallbacks();
50 if (adapter_) { 54 if (adapter_) {
51 adapter_->RemoveObserver(this); 55 adapter_->RemoveObserver(this);
52 adapter_ = NULL; 56 adapter_ = NULL;
53 } 57 }
54 } 58 }
55 59
56 void BluetoothLowEnergyCharacteristicsFinder::GattCharacteristicAdded( 60 void BluetoothLowEnergyCharacteristicsFinder::GattCharacteristicAdded(
57 BluetoothAdapter* adapter, 61 BluetoothAdapter* adapter,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 remote_service_.id = service->GetIdentifier(); 124 remote_service_.id = service->GetIdentifier();
121 } 125 }
122 } 126 }
123 127
124 void BluetoothLowEnergyCharacteristicsFinder::ResetCallbacks() { 128 void BluetoothLowEnergyCharacteristicsFinder::ResetCallbacks() {
125 success_callback_.Reset(); 129 success_callback_.Reset();
126 error_callback_.Reset(); 130 error_callback_.Reset();
127 } 131 }
128 132
129 } // namespace proximity_auth 133 } // namespace proximity_auth
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698