BluetoothRemoteGATTService
BluetoothRemoteGATTService 介面是 Web Bluetooth API 的一部分,它表示 GATT 伺服器提供的服務,包括裝置、引用服務的列表以及該服務的特性的列表。
例項屬性
BluetoothRemoteGATTService.device只讀 實驗性-
透過
BluetoothDevice例項返回有關藍牙裝置的資訊。 BluetoothRemoteGATTService.isPrimary只讀 實驗性-
返回一個布林值,指示這是主服務還是輔助服務。
BluetoothRemoteGATTService.uuid只讀 實驗性-
返回一個表示該服務 UUID 的字串。
例項方法
BluetoothRemoteGATTService.getCharacteristic()實驗性-
返回一個
Promise,該 Promise 解析為一個給定通用唯一識別符號 (UUID) 的BluetoothRemoteGATTCharacteristic例項。 BluetoothRemoteGATTService.getCharacteristics()實驗性-
返回一個
Promise,該 Promise 解析為一個Array,其中包含給定可選通用唯一識別符號 (UUID) 的BluetoothRemoteGATTCharacteristic例項。
規範
| 規範 |
|---|
| Web 藍牙 # bluetoothgattservice-interface |
瀏覽器相容性
載入中…