diff --git a/index.bs b/index.bs index 04f1e30..cd40e8f 100644 --- a/index.bs +++ b/index.bs @@ -2896,35 +2896,74 @@ spec: html
The connect()
method, when invoked,
- MUST return a new promise promise and
- run the following steps in parallel:
+ MUST perform the following steps:
this.device.{{[[representedDevice]]}}
is `null`,
- reject promise with a {{NetworkError}} and abort these steps.
- this.device.{{[[representedDevice]]}}
has no ATT Bearer,
- attempt to create one using the procedures described
- in "Connection Establishment" under GAP Interoperability Requirements.
+ queue a task to reject |promise| with a {{NetworkError}},
+ return |promise|,
+ and abort these steps.
this.{{[[activeAlgorithms]]}}
.
this.device.{{[[representedDevice]]}}
is `null`,
- reject promise with a {{NetworkError}} and abort these steps.
- this.device.{{[[representedDevice]]}}
has no ATT Bearer,
+ do the following sub-steps:
+ this.{{[[activeAlgorithms]]}}
.
+
+ Note: These procedures can wait forever
+ if a connectable advertisement isn't received.
+ The website should call {{disconnect()}}
+ if it no longer wants to connect.
+ this.{{[[activeAlgorithms]]}}
,
+ reject promise with an {{AbortError}} and abort these steps.
+ this
.
+ Queue a task to perform the following sub-steps:
+ this.{{[[activeAlgorithms]]}}
,
+ reject promise with an {{AbortError}},
+ garbage-collect the connection of
+ this.{{[[representedDevice]]}}
,
+ and abort these steps.
+ this.{{[[activeAlgorithms]]}}
.
+ this.device.{{[[representedDevice]]}}
is `null`,
+ reject promise with a {{NetworkError}},
+ garbage-collect the connection of
+ this.{{[[representedDevice]]}}
,
+ and abort these steps.
+ this
.
+ this.{{[[activeAlgorithms]]}}
+ to abort any active `connect()` calls.
this.{{connected}}
is false
, abort these steps.
this.device.{{[[representedDevice]]}}
.
deviceObj
in the whole UA
- with deviceObj.{{[[representedDevice]]}}
- the same device as device,
- deviceObj.gatt.{{BluetoothRemoteGATTServer/connected}}
is `false`,
- the UA SHOULD destroy
- device's ATT Bearer.
+ Garbage-collect the connection of |device|.
+ + To garbage-collect the connection of a |device|, + the UA must, do the following steps in parallel: +
+deviceObj
in the whole UA:
+ deviceObj.{{[[representedDevice]]}}
is
+ not the same device as device,
+ continue to the next |deviceObj|.
+ deviceObj.gatt.{{BluetoothRemoteGATTServer/connected}}
+ is `true`,
+ abort this algorithm.
+ deviceObj.gatt.{{[[activeAlgorithms]]}}
+ contains the {{Promise}} of a call to {{connect()}},
+ abort this algorithm.
+