| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 DEVICE_BLUETOOTH_BLUETOOTH_GATT_CONNECTION_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_GATT_CONNECTION_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_GATT_CONNECTION_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_GATT_CONNECTION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // a possible error via the callback. | 27 // a possible error via the callback. |
| 28 virtual ~BluetoothGattConnection(); | 28 virtual ~BluetoothGattConnection(); |
| 29 | 29 |
| 30 // Returns the Bluetooth address of the device that this connection is open | 30 // Returns the Bluetooth address of the device that this connection is open |
| 31 // to. | 31 // to. |
| 32 virtual std::string GetDeviceAddress() const = 0; | 32 virtual std::string GetDeviceAddress() const = 0; |
| 33 | 33 |
| 34 // Returns true if this connection is open. | 34 // Returns true if this connection is open. |
| 35 virtual bool IsConnected() = 0; | 35 virtual bool IsConnected() = 0; |
| 36 | 36 |
| 37 // Disconnects this GATT connection and calls |callback| upon completion. | 37 // Disconnects this GATT connection. The device may still remain connected due |
| 38 // After a successful invocation, the device may still remain connected due to | 38 // to other GATT connections. |
| 39 // other GATT connections. | 39 virtual void Disconnect() = 0; |
| 40 virtual void Disconnect(const base::Closure& callback) = 0; | |
| 41 | 40 |
| 42 protected: | 41 protected: |
| 43 BluetoothGattConnection(); | 42 BluetoothGattConnection(); |
| 44 | 43 |
| 45 private: | 44 private: |
| 46 DISALLOW_COPY_AND_ASSIGN(BluetoothGattConnection); | 45 DISALLOW_COPY_AND_ASSIGN(BluetoothGattConnection); |
| 47 }; | 46 }; |
| 48 | 47 |
| 49 } // namespace device | 48 } // namespace device |
| 50 | 49 |
| 51 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_CONNECTION_H_ | 50 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_CONNECTION_H_ |
| OLD | NEW |