BluetoothRemoteGATTServer:getPrimaryServices() 方法
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
BluetoothRemoteGATTServer.getPrimaryServices() 方法返回一个 Promise,其会兑现为由蓝牙设备为指定 BluetoothServiceUUID 提供的主要 BluetoothRemoteGATTService 对象列表。
语法
js
getPrimaryServices(bluetoothServiceUUID)
参数
bluetoothServiceUUID-
指定设备的蓝牙服务通用唯一标识符。
返回值
Promise,且该 promise 将会兑现为 BluetoothRemoteGATTService 对象的列表。
规范
| Specification |
|---|
| Web Bluetooth> # dom-bluetoothremotegattserver-getprimaryservices> |
浏览器兼容性
Loading…