Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: device/bluetooth/bluetooth_device.h

Issue 336933002: device/bluetooth: Introduce BluetoothGattConnection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Returning ERROR_UNSUPPORTED_DEVICE from platforms. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/bluetooth/bluetooth.gyp ('k') | device/bluetooth/bluetooth_device_chromeos.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « device/bluetooth/bluetooth.gyp ('k') | device/bluetooth/bluetooth_device_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698