Bluetooth

 

非标准
该特性是非标准的,请尽量不要在生产环境中使用它!

Web Bluetooth API 的Bluetooth接口返回指代BluetoothDevice带有指定选项的对象的Promise

接口

interface Bluetooth {
  Promise<BluetoothDevice> requestDevice(RequestDeviceOptions options);
};
Bluetooth implements EventTarget;
Bluetooth implements BluetoothDeviceEventHandlers;
Bluetooth implements CharacteristicEventHandlers;
Bluetooth implements ServiceEventHandlers;

特性

方法

Bluetooth.requestDevice()
返回一个包含指定选项的BluetoothDevice对象的Promise

详细说明

Specification Status Comment
Web Bluetooth
Bluetooth
Draft Initial definition.

浏览器兼容性

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 45.0 [1]        
Feature Android Android Webview Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support 未实现 未实现           48.0 [2]

[1] Behind a flag. Chrome OS only.

[2] Behind a flag. Requires Android 6 (Marshmallow).

文档标签和贡献者