BluetoothRemoteGATTServer:getPrimaryService() 方法
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
BluetoothRemoteGATTServer.getPrimaryService()
方法返回一个 Promise,其将兑现为由蓝牙设备提供的、指定蓝牙服务 UUID 的主 BluetoothRemoteGATTService
。
语法
js
getPrimaryService(bluetoothServiceUUID)
参数
bluetoothServiceUUID
-
指定设备的蓝牙服务通用唯一标识符,可以是 128 位 UUID、16 位或 32 位 UUID 别名,也可以是 GATT 已分配服务键列表中的字符串。
返回值
Promise
,且该 promise 将会兑现为 BluetoothRemoteGATTService
对象。
规范
Specification |
---|
Web Bluetooth> # dom-bluetoothremotegattserver-getprimaryservice> |
浏览器兼容性
Loading…