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 #ifndef COMPONENTS_PROXIMITY_AUTH_BLE_BLUETOOTH_LOW_ENERGY_CONNECTION_H_ | 5 #ifndef COMPONENTS_PROXIMITY_AUTH_BLE_BLUETOOTH_LOW_ENERGY_CONNECTION_H_ |
6 #define COMPONENTS_PROXIMITY_AUTH_BLE_BLUETOOTH_LOW_ENERGY_CONNECTION_H_ | 6 #define COMPONENTS_PROXIMITY_AUTH_BLE_BLUETOOTH_LOW_ENERGY_CONNECTION_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 NOTIFY_SESSION_READY, | 80 NOTIFY_SESSION_READY, |
81 WAITING_RESPONSE_SIGNAL, | 81 WAITING_RESPONSE_SIGNAL, |
82 CONNECTED, | 82 CONNECTED, |
83 }; | 83 }; |
84 | 84 |
85 // Constructs a Bluetooth low energy connection to the service with | 85 // Constructs a Bluetooth low energy connection to the service with |
86 // |remote_service_| on the |remote_device|. The |adapter| must be already | 86 // |remote_service_| on the |remote_device|. The |adapter| must be already |
87 // initaalized and ready. The GATT connection may alreaady be established and | 87 // initaalized and ready. The GATT connection may alreaady be established and |
88 // pass through |gatt_connection|. A subsequent call to Connect() must be | 88 // pass through |gatt_connection|. A subsequent call to Connect() must be |
89 // made. | 89 // made. |
90 BluetoothLowEnergyConnection( | 90 BluetoothLowEnergyConnection(const cryptauth::RemoteDevice& remote_device, |
91 const RemoteDevice& remote_device, | 91 scoped_refptr<device::BluetoothAdapter> adapter, |
92 scoped_refptr<device::BluetoothAdapter> adapter, | 92 const device::BluetoothUUID remote_service_uuid, |
93 const device::BluetoothUUID remote_service_uuid, | 93 BluetoothThrottler* bluetooth_throttler, |
94 BluetoothThrottler* bluetooth_throttler, | 94 int max_number_of_write_attempts); |
95 int max_number_of_write_attempts); | |
96 | 95 |
97 ~BluetoothLowEnergyConnection() override; | 96 ~BluetoothLowEnergyConnection() override; |
98 | 97 |
99 // proximity_auth::Connection: | 98 // proximity_auth::Connection: |
100 void Connect() override; | 99 void Connect() override; |
101 void Disconnect() override; | 100 void Disconnect() override; |
102 std::string GetDeviceAddress() override; | 101 std::string GetDeviceAddress() override; |
103 | 102 |
104 protected: | 103 protected: |
105 // Exposed for testing. | 104 // Exposed for testing. |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 base::TimeTicks start_time_; | 306 base::TimeTicks start_time_; |
308 | 307 |
309 base::WeakPtrFactory<BluetoothLowEnergyConnection> weak_ptr_factory_; | 308 base::WeakPtrFactory<BluetoothLowEnergyConnection> weak_ptr_factory_; |
310 | 309 |
311 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyConnection); | 310 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyConnection); |
312 }; | 311 }; |
313 | 312 |
314 } // namespace proximity_auth | 313 } // namespace proximity_auth |
315 | 314 |
316 #endif // COMPONENTS_PROXIMITY_AUTH_BLE_BLUETOOTH_LOW_ENERGY_CONNECTION_H_ | 315 #endif // COMPONENTS_PROXIMITY_AUTH_BLE_BLUETOOTH_LOW_ENERGY_CONNECTION_H_ |
OLD | NEW |