Readonly
Experimental
Wearable Only
propertiesThe supported properties (e.g., read, write) of the characteristic, as an Array of Bluetooth.CharacteristicProperty values.
Readonly
Experimental
Wearable Only
uuidThe unique identifier of this characteristic.
Experimental
Wearable Only
Retrieve a specific Bluetooth.BluetoothGattDescriptor by its UUID from this characteristic.
Experimental
Wearable Only
Retrieve all descriptors associated with this characteristic.
Returns the name of this object's type.
Returns true if the object matches or derives from the passed in type.
Returns true if this object is the same as other
. Useful for checking if two references point to the same thing.
Experimental
Wearable Only
Read and receive the current value of the characteristic.
Returns: The value in a Uint8Array
Experimental
Wearable Only
Register the given callback to receive notifications. Registering a callback will unsubscribe any previous registration on this Characteristic.
callback
The callback to register, which takes a single parameter value
of type Uint8Array
.
try {
const value = await characteristic.registerNotifications();
console.log("Received Uint8Array data: ", value);
} catch (error) {
console.error("Failed to register notifications: ", error);
}
Returns: Promise resolving to void when the callback is successfully registered.
Experimental
Wearable Only
Unregister all notifications.
Returns: Promise resolving to void when all notifications are successfully unregistered.
Experimental
Wearable Only
Write a new value to the characteristic.
value
The value in a Uint8Array
Returns: Promise resolving to void when the value is successfully written.
Experimental
Wearable Only
Write a new value to the characteristic without awaiting acknowledgment.
value
The value in a Uint8Array
A characteristic of the Bluetooth GATT device.
Characteristics are the individual pieces of data within a Bluetooth.BluetoothGattService that provide specific information. For example, a heart rate sensor might have a Heart Rate service, and that service might have characteristics including "Heart Rate Measurement," "Sensor Location," etc.
Value (Bluetooth.BluetoothGattCharacteristic.readValue, Bluetooth.BluetoothGattCharacteristic.writeValue): The actual data being exchanged.
Properties (Bluetooth.BluetoothGattCharacteristic.properties): Define how the characteristic can be accessed (e.g., read, write, notify, indicate).
Descriptors ({Bluetooth.BluetoothGattCharacteristic.getDescriptor, Bluetooth.BluetoothGattCharacteristic.getDescriptors): Provide additional information about the characteristic, such as its units or format.
UUID (Bluetooth.BluetoothGattCharacteristic.uuid): A unique identifier that identifies the characteristic.
Common characteristics include battery level, heart rate, temperature, and device name.
See
Returned By: Bluetooth.BluetoothGattService#getCharacteristic