OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |