From 218934fa2ed1c702a6d3923d2aa2cc6b43c48684 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:43:23 -0500 Subject: initial commit --- files/th/web/api/bluetooth/index.html | 77 +++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 files/th/web/api/bluetooth/index.html (limited to 'files/th/web/api/bluetooth/index.html') 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 +--- +

{{APIRef("Bluetooth API")}}{{securecontext_header}}{{SeeCompatTable}}

+ +

The Bluetooth interface of the Web Bluetooth API returns a {{jsxref("Promise")}} to a {{domxref("BluetoothDevice")}} object with the specified options.

+ +

Interface

+ +
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;
+ +

Properties

+ +

Inherits properties from its parent {{domxref("EventTarget")}}.

+ +
+
{{domxref("Bluetooth.referringDevice")}} {{readonlyinline}}
+
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 navigator.bluetooth.referringDevice.
+
+ +

Events

+ +
+
{{domxref("Bluetooth.onavailabilitychanged")}}
+
An event handler that runs when an event of type {{event("availabilitychanged")}} has fired.
+
+ +

Methods

+ +
+
{{domxref("Bluetooth.getAvailability()")}}
+
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.
+
{{domxref("Bluetooth.requestDevice()")}}
+
Returns a {{jsxref("Promise")}} to a {{domxref("BluetoothDevice")}} object with the specified options.
+
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Web Bluetooth', '#bluetooth', 'Bluetooth')}}{{Spec2('Web Bluetooth')}}Initial definition.
+ +

Browser compatibility

+ + + +

{{Compat("api.Bluetooth")}}

-- cgit v1.2.3-54-g00ecf