Definition
Web Bluetooth defines Bluetooth
[Exposed=Window, SecureContext]
interface Bluetooth : EventTarget {
Promise<boolean> getAvailability();
[SameObject]
readonly attribute BluetoothDevice? referringDevice;
Promise<sequence<BluetoothDevice>> getDevices();
Promise<BluetoothDevice> requestDevice(optional RequestDeviceOptions options = {});
};
Bluetooth includes BluetoothDeviceEventHandlers;
Bluetooth includes CharacteristicEventHandlers;
Bluetooth includes ServiceEventHandlers;
This interface is extended in the following specifications:
- Web Bluetooth Scanning
partial interface Bluetooth { [SecureContext] Promise<BluetoothLEScan> requestLEScan(optional BluetoothLEScanOptions options = {}); };
Consolidated IDL (across mixin and partials)
[Exposed=Window, SecureContext]
interface Bluetooth : EventTarget {
Promise<boolean> getAvailability();
[SameObject]
readonly attribute BluetoothDevice? referringDevice;
Promise<sequence<BluetoothDevice>> getDevices();
Promise<BluetoothDevice> requestDevice(optional RequestDeviceOptions options = {});
attribute EventHandler onadvertisementreceived;
attribute EventHandler ongattserverdisconnected;
attribute EventHandler oncharacteristicvaluechanged;
attribute EventHandler onserviceadded;
attribute EventHandler onservicechanged;
attribute EventHandler onserviceremoved;
[SecureContext]
Promise<BluetoothLEScan> requestLEScan(optional BluetoothLEScanOptions options = {});
};
Methods and attributes that return objects implementing Bluetooth
Referring IDL interfaces/dictionaries
Referring specifications
- Web Bluetooth Scanning refers to
Bluetooth