Readonly ExperimentalpropertiesThe supported properties (e.g., read, write) of the characteristic, as an Array of Bluetooth.CharacteristicProperty values.
Readonly ExperimentaluuidThe unique identifier of this characteristic.
ExperimentalRetrieve a specific Bluetooth.BluetoothGattDescriptor by its UUID from this characteristic.
ExperimentalRetrieve 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.
ExperimentalRegister 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.
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.