Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 30 additions & 8 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,7 @@ spec: permissions
interface BluetoothDevice {
readonly attribute DOMString id;
readonly attribute DOMString? name;
readonly attribute BluetoothRemoteGATTServer gatt;
readonly attribute BluetoothRemoteGATTServer? gatt;
readonly attribute FrozenArray<UUID> uuids;

Promise<void> watchAdvertisements();
Expand All @@ -1605,7 +1605,8 @@ spec: permissions
</p>

<p>
<dfn>gatt</dfn> provides a way to interact with this device's GATT server.
{{BluetoothDevice/gatt}} provides a way to interact with this device's GATT server
if the site has permission to use any of its services.
</p>

<p>
Expand Down Expand Up @@ -1645,6 +1646,17 @@ spec: permissions
The <a>Bluetooth device</a> this object represents.
</td>
</tr>
<tr>
<td><dfn>\[[gatt]]</dfn></td>
<td>
a new {{BluetoothRemoteGATTServer}} instance with
its {{BluetoothRemoteGATTServer/device}} attribute initialized to `this`
and its {{BluetoothRemoteGATTServer/connected}} attribute initialized to `false`.
</td>
<td>
Does not change.
</td>
</tr>
<tr>
<td><dfn>\[[allowedServices]]</dfn></td>
<td>`undefined`</td>
Expand Down Expand Up @@ -1735,12 +1747,6 @@ spec: permissions
<li>
Initialize <code><var>result</var>.watchingAdvertisements</code> to `false`.
</li>
<li>
Set <code><var>result</var>.gatt.{{BluetoothRemoteGATTServer/device}}</code> to <var>result</var>.
</li>
<li>
Set <code><var>result</var>.gatt.{{BluetoothRemoteGATTServer/connected}}</code> to `false`.
</li>
<li>
Add <var>device</var>'s
advertised <a>Service UUIDs</a>
Expand All @@ -1764,6 +1770,22 @@ spec: permissions
</li>
</ol>

<div algorithm>
<p>
Getting the <code><dfn attribute for="BluetoothDevice">gatt</dfn></code> attribute
MUST perform the following steps:
</p>
<ol class="algorithm">
<li>
If <code>this.{{[[allowedServices]]}}</code> is an empty list,
return `null`.
</li>
<li>
Return <code>this.{{[[gatt]]}}</code>.
</li>
</ol>
</div>

<p>
Getting the <code><dfn attribute for="BluetoothDevice">uuids</dfn></code> attribute
MUST perform the following steps:
Expand Down
Loading