diff options
Diffstat (limited to 'files/th/web/api/bluetooth/index.html')
-rw-r--r-- | files/th/web/api/bluetooth/index.html | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/files/th/web/api/bluetooth/index.html b/files/th/web/api/bluetooth/index.html new file mode 100644 index 0000000000..74a1f52188 --- /dev/null +++ b/files/th/web/api/bluetooth/index.html @@ -0,0 +1,77 @@ +--- +title: Bluetooth +slug: Web/API/Bluetooth +tags: + - API + - Bluetooth + - Experimental + - Interface + - NeedsTranslation + - Reference + - TopicStub + - Web Bluetooth API +translation_of: Web/API/Bluetooth +--- +<p>{{APIRef("Bluetooth API")}}{{securecontext_header}}{{SeeCompatTable}}</p> + +<p>The <strong><code>Bluetooth</code></strong> interface of the <a href="/en-US/docs/Web/API/Web_Bluetooth_API">Web Bluetooth API</a> returns a {{jsxref("Promise")}} to a {{domxref("BluetoothDevice")}} object with the specified options.</p> + +<h2 id="Interface">Interface</h2> + +<pre class="syntaxbox">interface Bluetooth : EventTarget { + [SecureContext] Promise<boolean> getAvailability(); + [SecureContext] attribute EventHandler onavailabilitychanged; + [SecureContext, SameObject] readonly attribute BluetoothDevice? referringDevice; + [SecureContext] Promise<BluetoothDevice> requestDevice(optional RequestDeviceOptions options); +}; +Bluetooth implements BluetoothDeviceEventHandlers; +Bluetooth implements CharacteristicEventHandlers; +Bluetooth implements ServiceEventHandlers;</pre> + +<h2 id="Properties">Properties</h2> + +<p><em>Inherits properties from its parent {{domxref("EventTarget")}}.</em></p> + +<dl> + <dt>{{domxref("Bluetooth.referringDevice")}} {{readonlyinline}}</dt> + <dd>Returns a reference to the device, if any, from which the user opened the current page. For example, an Eddystone beacon might advertise a URL, which the user agent allows the user to open. A BluetoothDevice representing the beacon would be available through <code>navigator.bluetooth.referringDevice</code>.</dd> +</dl> + +<h3 id="Events">Events</h3> + +<dl> + <dt>{{domxref("Bluetooth.onavailabilitychanged")}}</dt> + <dd>An event handler that runs when an event of type {{event("availabilitychanged")}} has fired.</dd> +</dl> + +<h2 id="Methods">Methods</h2> + +<dl> + <dt>{{domxref("Bluetooth.getAvailability()")}}</dt> + <dd>Returns a {{jsxref("Promise")}} that resolved to a {{jsxref("Boolean")}} indicating whether the user-agent has the ability to support Bluetooth. Some user-agents let the user configure an option that affects what is returned by this value. If this option is set, that is the value returned by this method.</dd> + <dt>{{domxref("Bluetooth.requestDevice()")}}</dt> + <dd>Returns a {{jsxref("Promise")}} to a {{domxref("BluetoothDevice")}} object with the specified options.</dd> +</dl> + +<h2 id="Specifications">Specifications</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('Web Bluetooth', '#bluetooth', 'Bluetooth')}}</td> + <td>{{Spec2('Web Bluetooth')}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + + + +<p>{{Compat("api.Bluetooth")}}</p> |