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
read-only
no-link
Returns the BluetoothGattService that this characteristic belongs to.BluetoothGattCharacteristic.descriptors
read-only
no-link
Returns a cached array containing the BluetoothGattDescriptor objects that describe this characteristic.BluetoothGattCharacteristic.uuid
read-only
no-link
Returns a DOMString representing the UUID of this characteristic.BluetoothGattCharacteristic.instanceId
read-only
no-link
Returns a number representing the instance id of this characteristic.BluetoothGattCharacteristic.value
read-only
no-link
Returns The cached value of this characteristic. This value can be updated via theBluetoothGattCharacteristic.readValue()
method, characteristic notification, or indication from the remote device.BluetoothGattCharacteristic.permissions
read-only
no-link
Returns a bit mask that describes the operations permitted on this characteristic.BluetoothGattCharacteristic.properties
read-only
no-link
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.