| 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_CRYPTAUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CLIENT_CONNECTION_H_ | 5 #ifndef COMPONENTS_CRYPTAUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CLIENT_CONNECTION_H_ |
| 6 #define COMPONENTS_CRYPTAUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CLIENT_CONNECTION_H_ | 6 #define COMPONENTS_CRYPTAUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CLIENT_CONNECTION_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // receive connection response | | 48 // receive connection response | |
| 49 // opt: send data | opt: send data | 49 // opt: send data | opt: send data |
| 50 // receive data | receive data | 50 // receive data | receive data |
| 51 // opt: close connection | opt: close connection | 51 // opt: close connection | opt: close connection |
| 52 class BluetoothLowEnergyWeaveClientConnection | 52 class BluetoothLowEnergyWeaveClientConnection |
| 53 : public Connection, | 53 : public Connection, |
| 54 public device::BluetoothAdapter::Observer { | 54 public device::BluetoothAdapter::Observer { |
| 55 public: | 55 public: |
| 56 class Factory { | 56 class Factory { |
| 57 public: | 57 public: |
| 58 static std::unique_ptr<BluetoothLowEnergyWeaveClientConnection> | 58 static std::unique_ptr<Connection> |
| 59 NewInstance( | 59 NewInstance( |
| 60 const RemoteDevice& remote_device, | 60 const RemoteDevice& remote_device, |
| 61 const std::string& device_address, | 61 const std::string& device_address, |
| 62 scoped_refptr<device::BluetoothAdapter> adapter, | 62 scoped_refptr<device::BluetoothAdapter> adapter, |
| 63 const device::BluetoothUUID remote_service_uuid, | 63 const device::BluetoothUUID remote_service_uuid, |
| 64 BluetoothThrottler* bluetooth_throttler); | 64 BluetoothThrottler* bluetooth_throttler); |
| 65 | 65 |
| 66 // Exposed for testing. | 66 // Exposed for testing. |
| 67 static void SetInstanceForTesting(std::shared_ptr<Factory> factory); | 67 static void SetInstanceForTesting(std::shared_ptr<Factory> factory); |
| 68 | 68 |
| 69 protected: | 69 protected: |
| 70 // Exposed for testing. | 70 // Exposed for testing. |
| 71 virtual std::unique_ptr<BluetoothLowEnergyWeaveClientConnection> | 71 virtual std::unique_ptr<Connection> |
| 72 BuildInstance( | 72 BuildInstance( |
| 73 const RemoteDevice& remote_device, | 73 const RemoteDevice& remote_device, |
| 74 const std::string& device_address, | 74 const std::string& device_address, |
| 75 scoped_refptr<device::BluetoothAdapter> adapter, | 75 scoped_refptr<device::BluetoothAdapter> adapter, |
| 76 const device::BluetoothUUID remote_service_uuid, | 76 const device::BluetoothUUID remote_service_uuid, |
| 77 BluetoothThrottler* bluetooth_throttler); | 77 BluetoothThrottler* bluetooth_throttler); |
| 78 | 78 |
| 79 private: | 79 private: |
| 80 static std::shared_ptr<Factory> factory_instance_; | 80 static std::shared_ptr<Factory> factory_instance_; |
| 81 }; | 81 }; |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 weak_ptr_factory_; | 318 weak_ptr_factory_; |
| 319 | 319 |
| 320 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyWeaveClientConnection); | 320 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyWeaveClientConnection); |
| 321 }; | 321 }; |
| 322 | 322 |
| 323 } // namespace weave | 323 } // namespace weave |
| 324 | 324 |
| 325 } // namespace cryptauth | 325 } // namespace cryptauth |
| 326 | 326 |
| 327 #endif // COMPONENTS_CRYPTAUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CLIENT_CONNECTION
_H_ | 327 #endif // COMPONENTS_CRYPTAUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CLIENT_CONNECTION
_H_ |
| OLD | NEW |