From ba6a6832c340516374dc891a5145dfac954be0d3 Mon Sep 17 00:00:00 2001
From: Travis CI Resolve promise with result.
getDescriptor(descriptor)
method retrieves a Descriptor inside this Characteristic. When invoked, it MUST return
GetGATTChildren(attribute=
this
,
single=true,
uuidCanonicalizer=BluetoothUUID.getDescriptor
,
uuid=descriptor
,
allowedUuids=undefined
,
child type="GATT Descriptor")
getDescriptors(descriptor)
method retrieves a list of Descriptors inside this Characteristic. When invoked, it MUST return
GetGATTChildren(attribute=
@@ -4238,9 +4238,8 @@this
,
single=false,
uuidCanonicalizer=BluetoothUUID.getDescriptor
,
uuid=descriptor
,
allowedUuids=undefined
,
child type="GATT Descriptor")Resolve promise with propertiesObj.
BluetoothRemoteGATTDescriptor
represents a GATT Descriptor, which
+
BluetoothRemoteGATTDescriptor
represents a GATT Descriptor, which
provides further information about a Characteristic’s value.
[-Exposed =Window ,SecureContext ]interface { @@ -4252,134 +4251,133 @@
BluetoothRemoteGATTDescriptor
writeValue (BufferSource ); };
value
BluetoothRemoteGATTDescriptor
attributescharacteristic
is the GATT characteristic this descriptor belongs to.
- uuid
is the UUID of the characteristic descriptor, e.g. '00002902-0000-1000-8000-00805f9b34fb'
for the Client Characteristic Configuration descriptor.
value
is the currently cached descriptor value. This value gets
+
BluetoothRemoteGATTDescriptor
attributescharacteristic
is the GATT characteristic this descriptor belongs to.
+ uuid
is the UUID of the characteristic descriptor, e.g. '00002902-0000-1000-8000-00805f9b34fb'
for the Client Characteristic Configuration descriptor.
value
is the currently cached descriptor value. This value gets
updated when the value of the descriptor is read.
Instances of BluetoothRemoteGATTDescriptor
are created with the internal
+
Instances of BluetoothRemoteGATTDescriptor
are created with the internal
slots described in the following table:
Internal Slot - | Initial Value - | Description (non-normative) - | ||||||
---|---|---|---|---|---|---|---|---|
[[representedDescriptor]]
- | <always set in prose> - | The Descriptor this object represents, or null if the Descriptor
+
- To create a BluetoothRemoteGATTDescriptor representing a Descriptor descriptor,
+ |
BluetoothRemoteGATTDescriptor
representing a Descriptor descriptor,
the UA must return a new promise promise and run the following steps in parallel.
- Let result be a new instance of BluetoothRemoteGATTDescriptor
with its [[representedDescriptor]]
slot initialized to descriptor.
Initialize result.characteristic
from
+
Let result be a new instance of BluetoothRemoteGATTDescriptor
with its [[representedDescriptor]]
slot initialized to descriptor.
Initialize result.characteristic
from
the BluetoothRemoteGATTCharacteristic
instance representing
the Characteristic in which descriptor appears.
Initialize result.uuid
from the UUID of descriptor.
Initialize result.value
to null
.
+
Initialize result.uuid
from the UUID of descriptor.
Initialize result.value
to null
.
The UA MAY initialize result.value
to
a new DataView
wrapping a new ArrayBuffer
containing
the most recently read value from descriptor if this value is available.
Resolve promise with result.
- readValue()
method, when invoked, MUST run the following steps:
- If this.uuid
is blocklisted for reads, return a promise rejected with a SecurityError
and abort these steps.
If this.characteristic.service.device.gatt.
is connected
false
, return a promise rejected with a NetworkError
and
+
Resolve promise with result.
+ readValue()
method, when invoked, MUST run the following steps:
+ If this.uuid
is blocklisted for reads, return a promise rejected with a SecurityError
and abort these steps.
If this.characteristic.service.device.gatt.
is connected
false
, return a promise rejected with a NetworkError
and
abort these steps.
Let descriptor be this.
.[[representedDescriptor]]
If descriptor is null
, return a promise rejected with an InvalidStateError
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:
If the UA is currently using the Bluetooth system, it MAY reject promise with a NetworkError
and abort these steps.
Implementations may be able to avoid this NetworkError
,
+
Let descriptor be this.
.[[representedDescriptor]]
If descriptor is null
, return a promise rejected with an InvalidStateError
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:
If the UA is currently using the Bluetooth system, it MAY reject promise with a NetworkError
and abort these steps.
Implementations may be able to avoid this NetworkError
,
but for now sites need to serialize their use of this API
and/or give the user a way to retry failed operations. <https://github.com/WebBluetoothCG/web-bluetooth/issues/188>
Use either the Read Characteristic Descriptors or the Read Long Characteristic Descriptors sub-procedure to retrieve +
Use either the Read Characteristic Descriptors or the 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.
-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
+
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.
Let buffer be an ArrayBuffer
holding the retrieved
+
Let buffer be an ArrayBuffer
holding the retrieved
value, and assign new DataView(buffer)
to this.value
.
Resolve promise with this.value
.
writeValue(value)
method, when invoked, MUST run the
+ Resolve promise with this.value
.
writeValue(value)
method, when invoked, MUST run the
following steps:
- If this.uuid
is blocklisted for writes, return a promise rejected with a SecurityError
and abort these steps.
Let bytes be a copy of the bytes held by value
.
If bytes is more than 512 bytes long (the maximum length of an +
If this.uuid
is blocklisted for writes, return a promise rejected with a SecurityError
and abort these steps.
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.
If this.characteristic.service.device.gatt.
is connected
false
, return a promise rejected with a NetworkError
and
+
If this.characteristic.service.device.gatt.
is connected
false
, return a promise rejected with a NetworkError
and
abort these steps.
Let descriptor be this.
.[[representedDescriptor]]
If descriptor is null
, return a promise rejected with an InvalidStateError
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.
If the UA is currently using the Bluetooth system, it MAY reject promise with a NetworkError
and abort these steps.
Implementations may be able to avoid this NetworkError
,
+
Let descriptor be this.
.[[representedDescriptor]]
If descriptor is null
, return a promise rejected with an InvalidStateError
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.
If the UA is currently using the Bluetooth system, it MAY reject promise with a NetworkError
and abort these steps.
Implementations may be able to avoid this NetworkError
,
but for now sites need to serialize their use of this API
and/or give the user a way to retry failed operations. <https://github.com/WebBluetoothCG/web-bluetooth/issues/188>
Use either the Write Characteristic Descriptors or the Write
+ Use either the Write Characteristic Descriptors or the 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. Queue a task to perform the following steps: If promise is not in 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 Set Resolve promise with
-
- this.characteristic.service.device.gatt.
, reject promise with a [[activeAlgorithms]]
NetworkError
and abort
+
+
- this.characteristic.service.device.gatt.
, reject promise with a [[activeAlgorithms]]
NetworkError
and abort
these steps.this.value
to a new DataView
wrapping a new ArrayBuffer
containing bytes.undefined
.
Set this.value
to a new DataView
wrapping a new ArrayBuffer
containing bytes.
Resolve promise with undefined
.