--- 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.

浏览器兼容性

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