aboutsummaryrefslogtreecommitdiff
path: root/files/th/web/api/bluetooth
diff options
context:
space:
mode:
Diffstat (limited to 'files/th/web/api/bluetooth')
-rw-r--r--files/th/web/api/bluetooth/index.html77
-rw-r--r--files/th/web/api/bluetooth/onavailabilitychanged/index.html46
2 files changed, 123 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&lt;boolean&gt; getAvailability();
+  [SecureContext] attribute EventHandler onavailabilitychanged;
+  [SecureContext, SameObject] readonly attribute BluetoothDevice? referringDevice;
+  [SecureContext] Promise&lt;BluetoothDevice&gt; 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>
diff --git a/files/th/web/api/bluetooth/onavailabilitychanged/index.html b/files/th/web/api/bluetooth/onavailabilitychanged/index.html
new file mode 100644
index 0000000000..74e6881ee0
--- /dev/null
+++ b/files/th/web/api/bluetooth/onavailabilitychanged/index.html
@@ -0,0 +1,46 @@
+---
+title: Bluetooth.onavailabilitychanged
+slug: Web/API/Bluetooth/onavailabilitychanged
+translation_of: Web/API/Bluetooth/onavailabilitychanged
+---
+<p>{{APIRef("Bluetooth API")}}{{securecontext_header}}{{SeeCompatTable}}</p>
+
+<p><span class="seoSummary">The <strong><code>onavailabilitychanged</code></strong> property of the {{DOMxRef("Bluetooth")}} interface is an {{DOMxRef("EventHandler")}} that processes <code>availabilitychanged</code> events that fire when the Bluetooth system as a whole becomes available or unavailable to the {{Glossary("User Agent")}}.</span></p>
+
+<h2 id="Syntax">Syntax</h2>
+
+<pre class="syntaxbox"><em>Bluetooth</em>.onavailabilitychanged = <em>functionRef</em>;
+</pre>
+
+<h3 id="Value">Value</h3>
+
+<p><code>functionRef</code> is the handler function to be called when the Bluetooth <code>availabilitychanged</code> event fires.</p>
+
+<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>
+
+<div class="hidden"><font><font>ตารางความเข้ากันได้ในหน้านี้สร้างขึ้นจากข้อมูลที่มีโครงสร้าง </font><font>หากคุณต้องการมีส่วนร่วมกับข้อมูลโปรดตรวจสอบ</font></font><a href="https://github.com/mdn/browser-compat-data"><font><font>https://github.com/mdn/browser-compat-data</font></font></a><font><font>และส่งคำขอดึง</font></font></div>
+
+<p><font><font>{{compat ( "api.Bluetooth.onavailabilitychanged")}}</font></font></p>
+
+<h2 id="ดูสิ่งนี้ด้วย"><font><font>ดูสิ่งนี้ด้วย</font></font></h2>
+
+<ul>
+ <li><font><font>{{DOMxRef ( "Bluetooth.getAvailability")}}</font></font></li>
+</ul>