BluetoothGattCharacteristic
#
DescriptionThe BluetoothGattCharacteristic interface of the Bluetooth API represents a GATT service characteristic, which includes characteristic definition, value, properties and configuration info, and a list of descriptors that provide related information.
#
Interface overview#
PropertiesBluetoothGattCharacteristic.service
Returns the BluetoothGattService that this characteristic belongs to.
BluetoothGattCharacteristic.descriptors
Returns a cached array containing the BluetoothGattDescriptor objects that describe this characteristic.
BluetoothGattCharacteristic.uuid
Returns a DOMString representing the UUID of this characteristic.
BluetoothGattCharacteristic.instanceId
Returns a number representing the instance id of this characteristic.
BluetoothGattCharacteristic.value
Returns The cached value of this characteristic. This value can be updated via the BluetoothGattCharacteristic.readValue()
method, characteristic notification, or indication from the remote device.
BluetoothGattCharacteristic.permissions
Returns a bit mask that describes the operations permitted on this characteristic.
BluetoothGattCharacteristic.properties
Returns a bit mask that describes how to use the characteristic value.
#
MethodsBluetoothGattCharacteristic.readValue()
Reads the characteristic value from the remote device. The cached value property will also be updated after retrieving the value.
BluetoothGattCharacteristic.writeValue()
Writes the characteristic 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 BluetoothGattCharacteristic.value.
BluetoothGattCharacteristic.startNotifications()
Registers notifications/indications for this characteristic.
BluetoothGattCharacteristic.stopNotifications()
Unregisters notifications/indications for this characteristic.
BluetoothGattCharacteristic.addDescriptor()
Adds a descriptor to this characteristic.