B2G/Bluetooth/WebBluetooth-v2/BluetoothGattDescriptor: Difference between revisions

revise description of readValue in GattDescriptor
(Change "Promise<ArrayBuffer> writeValue(ArrayBuffer value)" to "Promise<void> writeValue(ArrayBuffer value)")
(revise description of readValue in GattDescriptor)
 
(2 intermediate revisions by 2 users not shown)
Line 12: Line 12:
   readonly attribute DOMString [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattDescriptor#uuid|uuid]];
   readonly attribute DOMString [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattDescriptor#uuid|uuid]];
   readonly attribute ArrayBuffer? [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattDescriptor#value|value]];
   readonly attribute ArrayBuffer? [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattDescriptor#value|value]];
   [Cached, Constant] readonly attribute [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattCharacteristic#Permissions|Permissions]] [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattDescriptor#permissions|permissions]];
   [Cached, Constant] readonly attribute [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattCharacteristic#GattPermissions|GattPermissions]] [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattDescriptor#permissions|permissions]];
   
   
   [NewObject] Promise<ArrayBuffer> [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattDescriptor#readValue.28.29|readValue()]];
   [NewObject] Promise<ArrayBuffer> [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattDescriptor#readValue.28.29|readValue()]];
Line 64: Line 64:


; Value Type
; Value Type
: dictionary [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattCharacteristic#Permissions|Permissions]]
: dictionary [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattCharacteristic#GattPermissions|GattPermissions]]


; Default Value
; Default Value
Line 76: Line 76:


; Description
; Description
: Read the descriptor value from the remote device. The cached value property is also updated after retrieving the value.
: Read the descriptor value from either remote device (client role) or the local device (server role). In client mode, the cached value property is also updated after retrieving the value from the remote GATT server.


; Return
; Return
: A Promise to indicate whether the operation is resolved or rejected. The Promise is resolved along with the value retrieved from the remote device.
: A Promise to indicate whether the operation is resolved or rejected. The Promise is resolved along with the value retrieved from the remote device or local device.


=== writeValue(ArrayBuffer value) ===
=== writeValue(ArrayBuffer value) ===


; Description
; Description
: Write the descriptor value to the remote device.
: Write the descriptor value to the GATT server. If the local device is the GATT client, the value will be written to the remote GATT server. On the other hand, if the local device is the GATT server, the value will be written to [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattDescriptor#value|value]].


; Parameter
; Parameter
: ''value''
: ''value''
:: Desired value to be written to the remote device.
:: Desired value to be written to the GATT server.


; Return
; Return
: A Promise to indicate whether the operation is resolved or rejected. The Promise is resolved along with the descriptor value after this write operation.
: A Promise to indicate whether the operation is resolved or rejected. The Promise is resolved along with the descriptor value after this write operation.
120

edits