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

Jump to navigation Jump to search
Line 164: Line 164:


; Description
; Description
: Read the characteristic value from the remote device.
: Read the characteristic value from the remote device. The cached value property will also be updated after retrieving the value.
: The cached value property will also be updated after retrieving the valuethe remote device.


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


=== writeValue(ArrayBuffer value) ===
=== writeValue(ArrayBuffer value) ===
Line 181: Line 179:


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


=== startNotifications() ===
=== startNotifications() ===
Line 190: Line 187:


; Return
; Return
: A Promise to indicate whether the operation is resolved or rejected.
: A Promise to indicate whether the operation is resolved or rejected. The Promise is rejected if there is no Client Characteristic Configuration descriptor (CCCD) for this characteristic.
: The Promise will be rejected if there is no Client Characteristic Configuration descriptor (CCCD) for this characteristic.


=== stopNotifications() ===
=== stopNotifications() ===
Line 199: Line 195:


; Return
; Return
: A Promise to indicate whether the operation is resolved or rejected.
: A Promise to indicate whether the operation is resolved or rejected. The Promise is rejected if there is no Client Characteristic Configuration descriptor (CCCD) for this characteristic.
: The Promise will be rejected if there is no Client Characteristic Configuration descriptor (CCCD) for this characteristic.


=== findDescriptor(DOMString uuid) ===
=== findDescriptor(DOMString uuid) ===


; Description
; Description
: The method finds a descriptor of this characteristic from the descriptors property by the given UUID.
: The method finds a descriptor of this characteristic from the descriptors property by the given UUID. When multiple descriptors with the same UUID exist, the first one is returned.
: When there are multiple descriptors with the same UUID existed, the first one will be returned.


; Parameters
; Parameters
Line 214: Line 208:
; Return
; Return
: The first descriptor with the given uuid in descriptors property.  
: The first descriptor with the given uuid in descriptors property.  
: A null pointer is returned if no descriptor is found by the given uuid.  
: A null pointer is returned if no descriptor is found by the given UUID.  


; Sample
; Sample
Confirmed users
891

edits

Navigation menu