From 901a3e2eb0c04c62f632d7864cb8a219f902ad83 Mon Sep 17 00:00:00 2001
From: Jeffrey Yasskin
spec: html
@@ -152,8 +132,6 @@ spec: html
spec: permissions
type: dfn
text: create a permission storage entry
- text: permission storage identifier
- text: retrieve the permission storage
text: retrieve a permission storage entry
@@ -1265,7 +1243,7 @@ spec: permissions
diff --git a/index.html b/index.html index 53be8df..da16eb7 100644 --- a/index.html +++ b/index.html @@ -1410,7 +1410,7 @@Web Bluetooth
-Draft Community Group Report,
+Draft Community Group Report,
- This version: @@ -2068,7 +2068,7 @@
When no ECMAScript code can observe an instance of
BluetoothRemoteGATTServer
server anymore, @@ -2915,17 +2915,17 @@a new promise promise and run the following steps in parallel:
-
- If
this.device@
is[[representedDevice]]
null
, reject promise with aNetworkError
and abort these steps. +- If
this.device@
is[[representedDevice]]
null
, reject promise with aNetworkError
and abort these steps.- If
this.device@
has no ATT Bearer, attempt to create one using the procedures described in "Connection Establishment" under GAP Interoperability Requirements. -[[representedDevice]]
- If this attempt fails, reject promise with a
NetworkError
and abort these steps. +- If this attempt fails, reject promise with a
NetworkError
and abort these steps.- Queue a task to perform the following sub-steps:
-
- If
this.device@
is[[representedDevice]]
null
, reject promise with aNetworkError
and abort these steps. +- If
this.device@
is[[representedDevice]]
null
, reject promise with aNetworkError
and abort these steps.- Set
this.connected
totrue
. -- Resolve promise with
this
. +- Resolve promise with
this
.The
disconnect()#dom-bluetoothremotegattserver-disconnectReferenced in:4.2. Per-origin Bluetooth device properties5.2. BluetoothRemoteGATTServer (2) (3)
method, when invoked, @@ -2953,7 +2953,7 @@If
gattServer.connected
istrue
, add promise togattServer@
.[[activeAlgorithms]]
- - Return the result of transforming promise with fulfillment and rejection handlers that perform the following steps: + Return the result of transforming promise with fulfillment and rejection handlers that perform the following steps:
- fulfillment handler
- @@ -2977,7 +2977,7 @@
- If service is not in
this.device@
, - return a promise rejected with a[[allowedServices]]
SecurityError
and abort these steps. + return a promise rejected with aSecurityError
and abort these steps.- Return GetGATTChildren(attribute=
this.device
,
single=true,
uuidCanonicalizer=BluetoothUUID.getService
,
uuid=service
,
allowedUuids=this.device@
,[[allowedServices]]
child type="GATT Primary Service")The
getPrimaryServices(service)#dom-bluetoothremotegattserver-getprimaryservicesReferenced in:5.2. BluetoothRemoteGATTServer
method, when invoked, @@ -2985,7 +2985,7 @@
- If service is present and not in
this.device@
, - return a promise rejected with a[[allowedServices]]
SecurityError
and abort these steps. + return a promise rejected with aSecurityError
and abort these steps.- Return GetGATTChildren(attribute=
this.device@
,[[representedDevice]]
single=false,
uuidCanonicalizer=BluetoothUUID.getService
,
uuid=service
,
allowedUuids=this.device@
,[[allowedServices]]
child type="GATT Primary Service") @@ -3025,13 +3025,13 @@Let result be a new instance of
BluetoothRemoteGATTService
.- Get the
BluetoothDevice
representing the device in which service appears, and let device be the result. -- If the previous step threw an error, reject promise with that error and abort these steps. +
- If the previous step threw an error, reject promise with that error and abort these steps.
- Initialize
result.device
from device.- Initialize
result.uuid
from the UUID of service.- If service is a Primary Service, initialize
result.isPrimary
to true. Otherwise initializeresult.isPrimary
to false. -- Resolve promise with result. +
- Resolve promise with result.
The
getCharacteristic(characteristic)#dom-bluetoothremotegattservice-getcharacteristicReferenced in:1.1. Examples (2) (3)5.1. GATT Information Model5.3. BluetoothRemoteGATTService
method retrieves a Characteristic inside this Service. @@ -3091,7 +3091,7 @@characteristic, and let propertiesPromise be the result.
- Wait for propertiesPromise to settle. -
- If propertiesPromise was rejected, resolve promise with propertiesPromise and +
- If propertiesPromise was rejected, resolve promise with propertiesPromise and abort these steps.
- Initialize
result.properties
from the value propertiesPromise was fulfilled with. @@ -3099,7 +3099,7 @@result.value to a new
DataView
wrapping a newArrayBuffer
containing the most recently read value from characteristic if this value is available. -- Resolve promise with result. +
- Resolve promise with result.
The
getDescriptor(descriptor)#dom-bluetoothremotegattcharacteristic-getdescriptorReferenced in:5.1. GATT Information Model5.4. BluetoothRemoteGATTCharacteristic
method retrieves a Descriptor inside this Characteristic. @@ -3113,28 +3113,28 @@
@@ -3142,14 +3142,14 @@
- If
this.uuid
is blacklisted for reads, - return a promise rejected with aSecurityError
and abort these steps. + return a promise rejected with aSecurityError
and abort these steps.- If
this.characteristic.service.device.gatt.
isconnected
false
, - return a promise rejected with aNetworkError
and abort these steps. + return a promise rejected with aNetworkError
and abort these steps.- Let characteristic be the Characteristic that
this
represents.- Return a
this.service.device.gatt
-connection-checking wrapper around a new promise promise and run the following steps in parallel:
- If the
Read
bit is not set - in characteristic’s properties, reject promise with aNotSupportedError
and abort these steps. + in characteristic’s properties, reject promise with aNotSupportedError
and abort these steps.- Use any combination of the sub-procedures in the Characteristic Value Read procedure to retrieve the value of characteristic. Handle errors as described in §5.7 Error handling. -
- If the previous step returned an error, reject promise with that error and abort these steps. +
- If the previous step returned an error, reject promise with that error and abort these steps.
- Queue a task to perform the following steps:
-
- If promise is not in
this.service.device.gatt@
, reject promise with a[[activeAlgorithms]]
NetworkError
and abort these steps. +- If promise is not in
this.service.device.gatt@
, reject promise with a[[activeAlgorithms]]
NetworkError
and abort these steps.- Let buffer be an
ArrayBuffer
holding the retrieved value, and assignnew DataView(buffer)
tothis.value
.- Fire an event named
characteristicvaluechanged
with itsbubbles
attribute initialized totrue
atthis
. -- Resolve promise with
this.value
. +- Resolve promise with
this.value
.
@@ -3177,13 +3177,13 @@
- If
this.uuid
is blacklisted for writes, - return a promise rejected with aSecurityError
and abort these steps. + return a promise rejected with aSecurityError
and abort these steps.- Let characteristic be the Characteristic that
this
represents.- Let bytes be a copy of the bytes held by
value
.- If bytes is more than 512 bytes long (the maximum length of an attribute value, per Long Attribute Values) - return a promise rejected with an
InvalidModificationError
and abort these steps. + return a promise rejected with anInvalidModificationError
and abort these steps.- If
this.service.device.gatt.
isconnected
false
, - return a promise rejected with aNetworkError
and abort these steps. + return a promise rejected with aNetworkError
and abort these steps.- Return a
this.service.device.gatt
-connection-checking wrapper around a new promise promise and run the following steps in parallel.@@ -3157,14 +3157,14 @@
Characteristic Value Write procedure to write bytes to characteristic. Handle errors as described in §5.7 Error handling. -
- If the previous step returned an error, reject promise with that error and abort these steps. +
- If the previous step returned an error, reject promise with that error and abort these steps.
- Queue a task to perform the following steps:
-
- If promise is not in
this.service.device.gatt@
, reject promise with a[[activeAlgorithms]]
NetworkError
and abort these steps. +- If promise is not in
this.service.device.gatt@
, reject promise with a[[activeAlgorithms]]
NetworkError
and abort these steps.- Set
this.value
to a newDataView
wrapping a newArrayBuffer
containing bytes. -- Resolve promise with
undefined
. +- Resolve promise with
undefined
.a new promise promise and run the following steps in parallel. See §5.6.4 Responding to Notifications and Indications for details of receiving notifications.
-
- If
this.uuid
is blacklisted for reads, reject promise with aSecurityError
and abort these steps. +- If
this.uuid
is blacklisted for reads, reject promise with aSecurityError
and abort these steps.- Let characteristic be the GATT Characteristic that
this
represents.- If neither of the
Notify
orIndicate
bits are set - in characteristic’s properties, reject promise with aNotSupportedError
and abort these steps. -- If characteristic’s active notification context set contains
navigator.bluetooth
, resolve promise withundefined
and abort these steps. -- If
this.service.device.gatt.
isconnected
false
, reject promise with aNetworkError
and abort these steps. + in characteristic’s properties, reject promise with aNotSupportedError
and abort these steps. +- If characteristic’s active notification context set contains
navigator.bluetooth
, resolve promise withundefined
and abort these steps. +- If
this.service.device.gatt.
isconnected
false
, reject promise with aNetworkError
and abort these steps.- Use any of the Characteristic Descriptors procedures to ensure that one of the
Notification
orIndication
bits in characteristic’s Client Characteristic Configuration descriptor is set, matching the constraints @@ -3191,9 +3191,9 @@value-change events if both bits are set. Handle errors as described in §5.7 Error handling. -
- If the previous step returned an error, reject promise with that error and abort these steps. +
- If the previous step returned an error, reject promise with that error and abort these steps.
- Add
navigator.bluetooth
to characteristic’s active notification context set. -- Resolve promise with
undefined
. +- Resolve promise with
undefined
.After notifications are enabled, the resulting value-change events won’t be delivered @@ -3210,7 +3210,7 @@
If characteristic’s active notification context set became empty, the UA SHOULD use any of the Characteristic Descriptors procedures to clear the
Notification
andIndication
bits in characteristic’s Client Characteristic Configuration descriptor. -- Queue a task to resolve promise with
undefined
. +- Queue a task to resolve promise with
undefined
.Queuing a task to resolve the promise ensures that no value change events due to notifications @@ -3281,13 +3281,13 @@
Characteristic Extended Properties isn’t clear whether the extended properties are immutable for a given Characteristic. If they are, the UA should be allowed to cache them. - - If the previous step returned an error, reject promise with that error and abort these steps. +
- If the previous step returned an error, reject promise with that error and abort these steps.
- Initialize
propertiesObj.reliableWrite
from the Reliable Write bit of extendedProperties.- Initialize
propertiesObj.writableAuxiliaries
from the Writable Auxiliaries bit of extendedProperties. -- Resolve promise with propertiesObj. +
- Resolve promise with propertiesObj. @@ -3322,15 +3322,15 @@
result.value to a new
DataView
wrapping a newArrayBuffer
containing the most recently read value from descriptor if this value is available. -- Resolve promise with result. +
- Resolve promise with result.
The
readValue()#dom-bluetoothremotegattdescriptor-readvalueReferenced in:5.5. BluetoothRemoteGATTDescriptor
method, when invoked, MUST run the following steps:@@ -3354,14 +3354,14 @@
- If
this.uuid
is blacklisted for reads, - return a promise rejected with aSecurityError
and abort these steps. + return a promise rejected with aSecurityError
and abort these steps.- If
this.characteristic.service.device.gatt.
isconnected
false
, - return a promise rejected with aNetworkError
and abort these steps. + return a promise rejected with aNetworkError
and abort these steps.- Let descriptor be the Descriptor that
this
represents.- Return a
this.characteristic.service.device.gatt
-connection-checking wrapper around a new promise promise and run the following steps in parallel: @@ -3339,14 +3339,14 @@Read Long Characteristic Descriptors sub-procedure to retrieve the value of descriptor. Handle errors as described in §5.7 Error handling. -
- If the previous step returned an error, reject promise with that error and abort these steps. +
- If the previous step returned an error, reject promise with that error and abort these steps.
- Queue a task to perform the following steps:
-
- If promise is not in
this.characteristic.service.device.gatt@
, reject promise with a[[activeAlgorithms]]
NetworkError
and abort these steps. +- If promise is not in
this.characteristic.service.device.gatt@
, reject promise with a[[activeAlgorithms]]
NetworkError
and abort these steps.- Let buffer be an
ArrayBuffer
holding the retrieved value, and assignnew DataView(buffer)
tothis.value
. -- Resolve promise with
this.value
. +- Resolve promise with
this.value
.
@@ -3386,7 +3386,7 @@
- If
this.uuid
is blacklisted for writes, - return a promise rejected with aSecurityError
and abort these steps. + return a promise rejected with aSecurityError
and abort these steps.- Let descriptor be the Descriptor that
this
represents.- Let bytes be a copy of the bytes held by
value
.- If bytes is more than 512 bytes long (the maximum length of an attribute value, per Long Attribute Values) - return a promise rejected with an
InvalidModificationError
and abort these steps. + return a promise rejected with anInvalidModificationError
and abort these steps.- If
this.characteristic.service.device.gatt.
isconnected
false
, - return a promise rejected with aNetworkError
and abort these steps. + return a promise rejected with aNetworkError
and abort these steps.- Return a
this.characteristic.service.device.gatt
-connection-checking wrapper around a new promise promise and run the following steps in parallel.@@ -3369,14 +3369,14 @@
Write Long Characteristic Descriptors sub-procedure to write bytes to descriptor. Handle errors as described in §5.7 Error handling. -
- If the previous step returned an error, reject promise with that error and abort these steps. +
- If the previous step returned an error, reject promise with that error and abort these steps.
- Queue a task to perform the following steps:
-
- If promise is not in
this.characteristic.service.device.gatt@
, reject promise with a[[activeAlgorithms]]
NetworkError
and abort these steps. +- If promise is not in
this.characteristic.service.device.gatt@
, reject promise with a[[activeAlgorithms]]
NetworkError
and abort these steps.- Set
this.value
to a newDataView
wrapping a newArrayBuffer
containing bytes. -- Resolve promise with
undefined
. +- Resolve promise with
undefined
.5.6
5.6.1. Bluetooth Tree#bluetooth-treeReferenced in:5.6.1. Bluetooth Tree5.6.2. Event types (2)5.6.4. Responding to Notifications and Indications5.6.5. Responding to Service Changes (2)
navigator.bluetooth
and - objects implementing theBluetoothDevice
,BluetoothRemoteGATTService
,BluetoothRemoteGATTCharacteristic
, orBluetoothRemoteGATTDescriptor
interface participate in a tree, + objects implementing theBluetoothDevice
,BluetoothRemoteGATTService
,BluetoothRemoteGATTCharacteristic
, orBluetoothRemoteGATTDescriptor
interface participate in a tree, simply named the Bluetooth tree.
- The children of
navigator.bluetooth
are theBluetoothDevice
objects representing @@ -3502,7 +3502,7 @@Let changedDevices be the set of Bluetooth devices that contain any Service in removedEntities, addedEntities, and changedServices.
- - For each
BluetoothDevice
deviceObj that is connected to a device in changedDevices, queue a task on its global object’s responsible event loop to do the following steps: + For eachBluetoothDevice
deviceObj that is connected to a device in changedDevices, queue a task on its global object’s responsible event loop to do the following steps:
- For each Service service in removedEntities: @@ -3621,7 +3621,7 @@
6. valid UUIDs. If a function in this specification takes a parameter whose type is UUID or a dictionary including a UUID attribute, and the argument passed in any UUID slot is not a valid UUID, - the function MUST return a promise rejected with a
TypeError
and abort its other steps. + the function MUST return a promise rejected with aTypeError
and abort its other steps.This standard provides the
BluetoothUUID.canonicalUUID(alias)
function to map a 16- or 32-bit Bluetooth UUID alias to its 128-bit form.Bluetooth devices are required to convert 16- and 32-bit UUIDs to 128-bit UUIDs @@ -3760,11 +3760,11 @@
the algorithm defined in §6.1 Standardized UUIDs for
BluetoothUUID.getService
as itscallbackfn
parameter, regardless of any modifications that have been made towindow
,Array
,Array.prototype
,Array.prototype.map
,Function
,Function.prototype
,BluetoothUUID
,BluetoothUUID.getService
, or other objects.This specification uses a read-only type - that is similar to WebIDL’s
+ that is similar to WebIDL’sFrozenArray
.FrozenArray
.@@ -4565,14 +4565,11 @@
- A read only ArrayBuffer#read-only-arraybufferReferenced in:4.3.1. BluetoothAdvertisingData (2) has
ArrayBuffer
's values and interface, except that attempting to write to its contents or transfer it - has the same effect as trying to write to aFrozenArray
's contents. + has the same effect as trying to write to aFrozenArray
's contents. This applies toTypedArray
s andDataView
s wrapped around theArrayBuffer
too.TypeError
- TypedArray
- fulfilled -
- global object
- realm
- [WebIDL-1] defines the following terms: @@ -4584,6 +4581,7 @@
children
- context object
- fire an event +
- participate in a tree
- [WHATWG-ENCODING] defines the following terms: @@ -4600,6 +4598,7 @@
browsing context
- environment settings object
- event handler idl attribute +
- global object
- in parallel
- incumbent settings object
- perform a microtask checkpoint @@ -4621,10 +4620,10 @@
PermissionName
- PermissionStatus
- PermissionStorage -
- associated permissiondescriptor
- create a permission storage entry
- name
- permission +
- permission descriptor type
- permission query algorithm
- permission request algorithm
- permission result type @@ -4638,18 +4637,14 @@
retrieve the permission storage
- state -
- - [promises-guide] defines the following terms: -
-
- a promise rejected with -
- reject -
- resolve -
- transforming -
- [promises-guide] defines the following terms:
- @@ -4660,7 +4655,9 @@
[WebIDL-1] defines the following terms:
+
-- BufferSource
- DOMException +
- FrozenArray
- InvalidModificationError
- NetworkError
- NotFoundError @@ -4669,11 +4666,6 @@
SyntaxError
- map entries
- - [WHATWG-DOM] defines the following terms: -
References
Normative References