--- title: Bluetooth slug: Web/API/Bluetooth tags: - API - 接口 - 网页蓝牙接口说明 - 蓝牙 - 说明 translation_of: Web/API/Bluetooth ---

{{ apiref("Web Bluetooth API") }} {{Non-standard_header()}}

Web Bluetooth API 的Bluetooth接口返回指代{{domxref("BluetoothDevice")}}带有指定选项的对象的{{jsxref("Promise")}}。

接口

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

特性

方法

{{domxref("Bluetooth.requestDevice()")}}
返回一个包含指定选项的{{domxref("BluetoothDevice")}}对象的{{jsxref("Promise")}}。

详细说明

Specification Status Comment
{{SpecName('Web Bluetooth', '#bluetooth', 'Bluetooth')}} {{Spec2('Web Bluetooth')}} Initial definition.

浏览器兼容性

{{CompatibilityTable}}
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support {{CompatChrome (45.0)}} [1]        
Feature Android Android Webview Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support {{CompatNo}} {{CompatNo}}           {{CompatChrome (48.0)}} [2]

[1] 注意事项:仅谷歌浏览器可用

[2] 注意事项:仅安卓6以上可用