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

Unified Diff: device/bluetooth/bluetooth_adapter.h

Issue 2353133005: Add the chrome.bluetoothLowEnergy.setAdvertisingInterval API. (Closed)
Patch Set: . Created 4 years, 3 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 e89f544f4f4a39d70f7b912f6c12d2ff74c266da..3b864c308c9cb25cd68b963f68862889ea3b000c 100644
--- a/device/bluetooth/bluetooth_adapter.h
+++ b/device/bluetooth/bluetooth_adapter.h
@@ -18,6 +18,7 @@
#include "base/containers/scoped_ptr_hash_map.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
+#include "base/time/time.h"
#include "build/build_config.h"
#include "device/bluetooth/bluetooth_advertisement.h"
#include "device/bluetooth/bluetooth_audio_sink.h"
@@ -244,7 +245,7 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapter
base::Callback<void(scoped_refptr<BluetoothAudioSink>)>;
using CreateAdvertisementCallback =
base::Callback<void(scoped_refptr<BluetoothAdvertisement>)>;
- using CreateAdvertisementErrorCallback =
+ using AdvertisementErrorCallback =
base::Callback<void(BluetoothAdvertisement::ErrorCode)>;
// Returns a weak pointer to a new adapter. For platforms with asynchronous
@@ -438,7 +439,17 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapter
virtual void RegisterAdvertisement(
std::unique_ptr<BluetoothAdvertisement::Data> advertisement_data,
const CreateAdvertisementCallback& callback,
- const CreateAdvertisementErrorCallback& error_callback) = 0;
+ const AdvertisementErrorCallback& error_callback) = 0;
+
+#if defined(OS_CHROMEOS) || defined(OS_LINUX)
ortuno 2016/09/22 03:02:25 I think we still want device/bluetooth tests. It d
+ // Sets the interval between two consecutive advertisements. Valid ranges
+ // for the interval are from 20ms to 10.24 seconds, with min <= max.
ortuno 2016/09/22 03:02:25 nit: Could you add the same caveats as the chrome
+ virtual void SetAdvertisingInterval(
ortuno 2016/09/21 23:26:11 Wouldn't this fit better as an argument of Registe
+ const base::TimeDelta& min,
+ const base::TimeDelta& max,
+ const base::Closure& callback,
+ const AdvertisementErrorCallback& error_callback) = 0;
+#endif
// Returns the local GATT services associated with this adapter with the
// given identifier. Returns NULL if the service doesn't exist.

Powered by Google App Engine
This is Rietveld 408576698