BluetoothRemoteGATTDescriptor

可用性有限

此特性不是基線特性,因為它在一些最廣泛使用的瀏覽器中不起作用。

實驗性: 這是一項實驗性技術
在生產中使用此技術之前,請仔細檢查瀏覽器相容性表格

安全上下文: 此功能僅在安全上下文(HTTPS)中可用,且支援此功能的瀏覽器數量有限。

Web Bluetooth API 的 BluetoothRemoteGATTDescriptor 介面提供了 GATT 描述符,它提供了關於特性(characteristic)值的更多資訊。

例項屬性

BluetoothRemoteGATTDescriptor.characteristic 只讀 實驗性

返回此描述符所屬的 BluetoothRemoteGATTCharacteristic

BluetoothRemoteGATTDescriptor.uuid 只讀 實驗性

返回特性描述符的 UUID,例如客戶端特性配置描述符的 UUID 為 "00002902-0000-1000-8000-00805f9b34fb"

BluetoothRemoteGATTDescriptor.value 只讀 實驗性

返回當前快取的描述符值。當描述符的值被讀取時,此值會更新。

例項方法

BluetoothRemoteGATTDescriptor.readValue() 實驗性

返回一個 Promise,該 Promise 會解析為一個 ArrayBuffer,其中包含 value 屬性的副本(如果可用且受支援)。否則,將丟擲錯誤。

BluetoothRemoteGATTDescriptor.writeValue() 實驗性

value 屬性設定為 ArrayBuffer 中包含的位元組,並返回一個 Promise

規範

規範
Web 藍牙
# bluetoothgattdescriptor-interface

瀏覽器相容性