Skip to content

Commit

Permalink
Use 'implements' to get the event handling members, rather than inher…
Browse files Browse the repository at this point in the history
…itance.

This adds back the event handling support to navigator.bluetooth that got lost
in c40ada3.

Contributes to #119.
  • Loading branch information
jyasskin committed Jun 8, 2015
1 parent 8e3e01e commit f69ec66
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,9 @@ <h2>Device Discovery</h2>
interface Bluetooth {
Promise&lt;BluetoothDevice> requestDevice(RequestDeviceOptions options);
};
Bluetooth implements EventTarget;
Bluetooth implements CharacteristicEventHandlers;
Bluetooth implements ServiceEventHandlers;
</pre>
<div class="note" title="Bluetooth members">
<p>
Expand Down Expand Up @@ -943,7 +946,7 @@ <h2><dfn>BluetoothDevice</dfn></h2>
"usb"
};

interface BluetoothDevice : ServiceEventHandlers {
interface BluetoothDevice {
readonly attribute DOMString instanceID;
readonly attribute DOMString? name;
readonly attribute BluetoothAdvertisingData adData;
Expand All @@ -957,6 +960,9 @@ <h2><dfn>BluetoothDevice</dfn></h2>
readonly attribute UUID[] uuids;
Promise&lt;BluetoothGATTRemoteServer> connectGATT();
};
BluetoothDevice implements EventTarget;
BluetoothDevice implements CharacteristicEventHandlers;
BluetoothDevice implements ServiceEventHandlers;
</pre>

<div class="note" title="BluetoothDevice attributes">
Expand Down Expand Up @@ -1545,14 +1551,17 @@ <h2><dfn>BluetoothGATTRemoteServer</dfn></h2>
</p>

<pre class="idl">
interface BluetoothGATTRemoteServer : ServiceEventHandlers {
interface BluetoothGATTRemoteServer {
readonly attribute BluetoothDevice device;
readonly attribute boolean connected;
void disconnect();
Promise&lt;BluetoothGATTService> getPrimaryService(BluetoothServiceUUID service);
Promise&lt;sequence&lt;BluetoothGATTService>>
getPrimaryServices(optional BluetoothServiceUUID service);
};
BluetoothGATTRemoteServer implements EventTarget;
BluetoothGATTRemoteServer implements CharacteristicEventHandlers;
BluetoothGATTRemoteServer implements ServiceEventHandlers;
</pre>

<div class="note" title="BluetoothGATTRemoteServer attributes">
Expand Down Expand Up @@ -1646,7 +1655,7 @@ <h2><dfn>BluetoothGATTService</dfn></h2>
</p>

<pre class="idl">
interface BluetoothGATTService : ServiceEventHandlers {
interface BluetoothGATTService {
readonly attribute BluetoothDevice device;
readonly attribute UUID uuid;
readonly attribute boolean isPrimary;
Expand All @@ -1659,6 +1668,9 @@ <h2><dfn>BluetoothGATTService</dfn></h2>
Promise&lt;sequence&lt;BluetoothGATTService>>
getIncludedServices(optional BluetoothServiceUUID service);
};
BluetoothGATTService implements EventTarget;
BluetoothGATTService implements CharacteristicEventHandlers;
BluetoothGATTService implements ServiceEventHandlers;
</pre>

<div class="note" title="BluetoothGATTService attributes">
Expand Down Expand Up @@ -1810,7 +1822,7 @@ <h2><dfn>BluetoothGATTCharacteristic</dfn></h2>
<p><a>BluetoothGATTCharacteristic</a> represents a GATT <a>Characteristic</a>, which is a basic data element that provides further information about a peripheral's service.</p>

<pre class="idl">
interface BluetoothGATTCharacteristic : CharacteristicEventHandlers {
interface BluetoothGATTCharacteristic {
readonly attribute BluetoothGATTService service;
readonly attribute UUID uuid;
readonly attribute CharacteristicProperties properties;
Expand All @@ -1823,6 +1835,8 @@ <h2><dfn>BluetoothGATTCharacteristic</dfn></h2>
Promise&lt;void> startNotifications();
Promise&lt;void> stopNotifications();
};
BluetoothGATTCharacteristic implements EventTarget;
BluetoothGATTCharacteristic implements CharacteristicEventHandlers;
</pre>

<div class="note" title="BluetoothGATTCharacteristic attributes">
Expand Down Expand Up @@ -2568,7 +2582,7 @@ <h2>IDL event handlers</h2>

<pre class="idl">
[NoInterfaceObject]
interface CharacteristicEventHandlers : EventTarget {
interface CharacteristicEventHandlers {
attribute EventHandler oncharacteristicvaluechanged;
};
</pre>
Expand All @@ -2580,7 +2594,7 @@ <h2>IDL event handlers</h2>

<pre class="idl">
[NoInterfaceObject]
interface ServiceEventHandlers : CharacteristicEventHandlers {
interface ServiceEventHandlers {
attribute EventHandler onserviceadded;
attribute EventHandler onservicechanged;
attribute EventHandler onserviceremoved;
Expand Down Expand Up @@ -3363,6 +3377,8 @@ <h2>Terminology and Conventions</h2>
<ul>
<li><a href="https://dom.spec.whatwg.org/#concept-tree-child"
><dfn>children</dfn></a></li>
<li><a href="https://dom.spec.whatwg.org/#interface-eventtarget"
><dfn><code>EventTarget</code></dfn></a></li>
<li><a href="https://dom.spec.whatwg.org/#concept-event-fire"
><dfn>fire an event</dfn></a></li>
<li><a href="https://dom.spec.whatwg.org/#concept-tree-participate"
Expand Down

0 comments on commit f69ec66

Please sign in to comment.