BluetoothCharacteristic class
A Bluetooth low energy characteristic. This is where the actual data of the device is stored and how you send or receive data from the device.
Read the properties value to see what this characteristic is capable of! Not all characteristics are the same.
See BluetoothDefaultCharacteristicUUIDS for a list of default UUIDS provided in the Bluetooth low energy specification.
You can get a BluetoothCharacteristic by calling BluetoothService.getCharacteristic.
Constructors
- BluetoothCharacteristic(WebBluetoothRemoteGATTCharacteristic _characteristic)
- A constructor for a new characteristic.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasProperties → bool
-
Check to see if properties has any properties at all. Some browsers
don't have this feature implemented yet.
no setter
- isNotifying → bool
-
Check to see if the current characteristic is notifying.
no setter
- lastValue → ByteData
-
Get the last value retrieved from the BluetoothCharacteristic.
no setter
- properties → BluetoothCharacteristicProperties
-
Get the properties of the BluetoothCharacteristic. This will contain
the properties of what the BluetoothCharacteristic does and doesn't
support.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- uuid → String
-
The uuid of the characteristic
no setter
-
value
→ Stream<
ByteData> -
A Stream of
ByteData
with the values read from the BluetoothCharacteristic.no setter
Methods
-
getDescriptor(
String descriptorUUID) → Future< BluetoothDescriptor> -
Return a
BluetoothDescriptor
for this characteristic. -
getDescriptors(
) → Future< List< BluetoothDescriptor> > - Return a list BluetoothDescriptors for this characteristic.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readValue(
{Duration timeout = const Duration(seconds: 5)}) → Future< ByteData> - Will read the value of the characteristic. The value read will be returned and also added to the value stream.
-
startNotifications(
) → Future< void> - Request the BluetoothCharacteristic to start notifying. This means that the Bluetooth device will give an event everytime that the value of the characteristic changes.
-
stopNotifications(
) → Future< void> - Request the BluetoothCharacteristic to stop notifying. This means that you will not long get notifications of changes to the value.
-
toString(
) → String -
A string representation of this object.
inherited
-
writeValueWithoutResponse(
Uint8List data) → Future< void> - Write a new value to the characteristic without waiting for a response from the Bluetooth device.
-
writeValueWithResponse(
Uint8List data) → Future< void> - Write a new value to the characteristic with waiting for a response from the Bluetooth device.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited