Index: device/bluetooth/bluetooth_device.h |
diff --git a/device/bluetooth/bluetooth_device.h b/device/bluetooth/bluetooth_device.h |
index d8f5eed86f001625e30f856fa05fb72307b632bd..582caf34fd24a57be1f85cdc7f987e8931e5e7aa 100644 |
--- a/device/bluetooth/bluetooth_device.h |
+++ b/device/bluetooth/bluetooth_device.h |
@@ -18,6 +18,7 @@ |
namespace device { |
+class BluetoothGattConnection; |
class BluetoothGattService; |
class BluetoothSocket; |
class BluetoothUUID; |
@@ -381,6 +382,21 @@ class BluetoothDevice { |
const ConnectToServiceCallback& callback, |
const ConnectToServiceErrorCallback& error_callback) = 0; |
+ // Opens a new GATT connection to this device. On success, a new |
+ // BluetoothGattConnection will be handed to the caller via |callback|. On |
+ // error, |error_callback| will be called. The connection will be kept alive, |
+ // as long as there is at least one active GATT connection. In the case that |
+ // the underlying connection gets terminated, either due to a call to |
+ // BluetoothDevice::Disconnect or other unexpected circumstances, the |
+ // returned BluetoothGattConnection will be automatically marked as inactive. |
+ // To monitor the state of the connection, observe the |
+ // BluetoothAdapter::Observer::DeviceChanged method. |
+ typedef base::Callback<void(scoped_ptr<BluetoothGattConnection>)> |
+ GattConnectionCallback; |
+ virtual void CreateGattConnection( |
+ const GattConnectionCallback& callback, |
+ const ConnectErrorCallback& error_callback) = 0; |
+ |
// Starts monitoring the connection properties, RSSI and TX power. These |
// properties will be tracked, and updated when their values change. Exactly |
// one of |callback| or |error_callback| will be run. |