安全上下文
此特征只可用于
安全上下文
(HTTPS),在某些或所有
支持浏览器
.
这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
getDevices()
方法为
蓝牙
interface of
Web Bluetooth API
exposes the Bluetooth devices this origin is allowed to access. This method does not display any permission prompts.
注意:
此方法返回
BluetoothDevice
for each device the origin is currently allowed to access, even the ones that are out of range or powered off. The program can detect when a device comes online or into range by watching for BlueTooth advertisements by calling
BluetoothDevice.watchAdvertisements()
on that device.
var readerPromise = Bluetooth.getDevices();
None.
A
Promise
that resolves with an array of
BluetoothDevice
。
This method doesn't throw any exceptions.
| 规范 | 状态 | 注释 |
|---|---|---|
|
Web Bluetooth
The definition of 'getDevices()' in that specification. |
草案 | 初始定义。 |
No compatibility data found. Please contribute data for "api.Bluetooth.getDevices" (depth: 1) to the MDN 兼容性数据存储库 .
蓝牙