diff --git a/scanning.bs b/scanning.bs index 1bda59f..bce2c60 100644 --- a/scanning.bs +++ b/scanning.bs @@ -273,8 +273,9 @@ spec: html }; dictionary BluetoothLEScanOptions { - required sequence<BluetoothLEScanFilterInit> filters; + sequence<BluetoothLEScanFilterInit> filters; boolean keepRepeatedDevices = false; + boolean acceptAllAdvertisements = false; }; partial interface Bluetooth { @@ -311,6 +312,10 @@ spec: html doesn't guarantee you won't get redundant events; it just allows the UA to save power by omitting them.
++ In the rare case that you want to receive every advertisement without filtering them, + use the acceptAllAdvertisements field. +
|options|.acceptAllAdvertisements
is `true`,
+ and |options|.filters
is present,
+ reject |promise| with a {{TypeError}} and abort these steps.
+
+ Note: There's no need to include filters if all advertisements are being accepted.
+ |options|.acceptAllAdvertisements
is `false`,
+ and |options|.filters
is either absent or empty,
+ reject |promise| with a {{TypeError}} and abort these steps.
+
+ Note: An empty set of filters wouldn't return any advertisements.
+ |options|.filters.map(filter=>new
@@ -334,12 +353,11 @@ spec: html
name: "bluetooth-le-scan",
filters: options.filters,
keepRepeatedDevices: options.keepRepeatedDevices,
+ acceptAllAdvertisements: options.acceptAllAdvertisements,
}
-
- This may require that this algorithm was triggered by user activation.
-
+ Note: This may require that this algorithm was triggered by user activation.
|options|.keepRepeatedDevices
|options|.acceptAllAdvertisements
callbackfn
parameter,
regardless of any modifications that have been made to window
,
Array
, Array.prototype
, Array.prototype.map
,
- Function
, Function.prototype
,
+ Function
, Function.prototype
,
BluetoothLEScanFilter
, or other objects.
diff --git a/scanning.html b/scanning.html
index 90c13f7..8b21e18 100644
--- a/scanning.html
+++ b/scanning.html
@@ -1587,8 +1587,9 @@ true
.
Note that setting keepRepeatedDevices
to false
doesn’t guarantee you won’t get redundant events;
it just allows the UA to save power by omitting them.
+ In the rare case that you want to receive every advertisement without filtering them, + use the acceptAllAdvertisements field.
The requestLEScan(options)
method,
when invoked, MUST return a new promise promise and run the following steps in parallel:
options.acceptAllAdvertisements
is true
,
+ and options.filters
is present, reject promise with a TypeError
and abort these steps.
+ Note: There’s no need to include filters if all advertisements are being accepted.
+options.acceptAllAdvertisements
is false
,
+ and options.filters
is either absent or empty, reject promise with a TypeError
and abort these steps.
+ Note: An empty set of filters wouldn’t return any advertisements.
options.filters.map(filter=>new BluetoothLEScanFilter
(filter))
.
If this throws an exception, reject promise with that exception and abort these steps.
This may require that this algorithm was triggered by user activation.
+Note: This may require that this algorithm was triggered by user activation.
"denied"
,
reject promise with a NotAllowedError
and abort these steps.
keepRepeatedDevices
options.keepRepeatedDevices
+ acceptAllAdvertisements
+ options.acceptAllAdvertisements
active
true
@@ -1684,6 +1699,7 @@ null
.
+ TypeError
.
+ Note: A filter can’t implicitly allow all advertisements.
+ Use acceptAllAdvertisements
to explicitly do it.
this
's attribute with a matching identifier to the value of the member.
If the member’s type is BluetoothServiceUUID
,
@@ -1730,7 +1750,8 @@ An advertising event event matches a BluetoothLEScan
scan if the following steps return match
:
scan.filters
,
+ scan.acceptAllAdvertisements
is false
and event doesn’t match any filter in scan.filters
,
return no match
.
scan.keepRepeatedDevices
is false
,
there is a BluetoothDevice
device that
@@ -2135,6 +2156,13 @@