语法
js
getDevices()
参数
无。
返回值
一个 Promise,其会兑现为一个 BluetoothDevice 对象数组。
异常
SecurityErrorDOMException
规范
| 规范 |
|---|
| Web Bluetooth> # dom-bluetooth-getdevices> |
此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。
Bluetooth 接口的 getDevices() 方法返回包含此来源被允许访问的蓝牙设备(包括那些超出范围和已关闭电源的设备)的数组。
getDevices()
无。
一个 Promise,其会兑现为一个 BluetoothDevice 对象数组。
SecurityError DOMException| 规范 |
|---|
| Web Bluetooth> # dom-bluetooth-getdevices> |