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

Unified Diff: device/bluetooth/bluetooth_adapter.h

Issue 278663002: Implement chrome.bluetoothSocket.listenUsing*() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix BluetoothAdapterMac include typo Created 6 years, 7 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
Index: device/bluetooth/bluetooth_adapter.h
diff --git a/device/bluetooth/bluetooth_adapter.h b/device/bluetooth/bluetooth_adapter.h
index 6c9780ef1439ca4fa2e40073b30b3144a826eadb..9323ff724847a0116f6a797e0753bca68b39da48 100644
--- a/device/bluetooth/bluetooth_adapter.h
+++ b/device/bluetooth/bluetooth_adapter.h
@@ -19,6 +19,8 @@
namespace device {
class BluetoothDiscoverySession;
+class BluetoothSocket;
+class BluetoothUUID;
struct BluetoothOutOfBandPairingData;
@@ -223,6 +225,38 @@ class BluetoothAdapter : public base::RefCounted<BluetoothAdapter> {
// incoming pairing requests.
virtual BluetoothDevice::PairingDelegate* DefaultPairingDelegate();
+ // Creates an RFCOMM service on this adapter advertised with UUID |uuid|,
+ // listening on channel |channel|, which may be the constant |kChannelAuto|
+ // to automatically allocate one. The socket will require encryption unless
+ // |insecure| is set to true. |callback| will be called on success with a
+ // BluetoothSocket instance that is to be owned by the received.
+ // |error_callback| will be called on failure with a message indicating the
+ // cause.
+ typedef base::Callback<void(scoped_refptr<BluetoothSocket>)>
+ CreateServiceCallback;
+ typedef base::Callback<void(const std::string& message)>
+ CreateServiceErrorCallback;
+ static const int kChannelAuto;
+ virtual void CreateRfcommService(
+ const BluetoothUUID& uuid,
+ int channel,
+ bool insecure,
+ const CreateServiceCallback& callback,
+ const CreateServiceErrorCallback& error_callback) = 0;
+
+ // Creates an L2CAP service on this adapter advertised with UUID |uuid|,
+ // listening on PSM |psm|, which may be the constant |kPsmAuto| to
+ // automatically allocate one. |callback| will be called on success with a
+ // BluetoothSocket instance that is to be owned by the received.
+ // |error_callback| will be called on failure with a message indicating the
+ // cause.
+ static const int kPsmAuto;
+ virtual void CreateL2capService(
+ const BluetoothUUID& uuid,
+ int psm,
+ const CreateServiceCallback& callback,
+ const CreateServiceErrorCallback& error_callback) = 0;
+
protected:
friend class base::RefCounted<BluetoothAdapter>;
friend class BluetoothDiscoverySession;

Powered by Google App Engine
This is Rietveld 408576698