CharacteristicSubscription class
Manages subscription to a characteristic's notifications or indications.
Instances are typically obtained via the notifications or indications
getters on BleCharacteristic.
call subscribe to instruct the device to start sending data. call unsubscribe To stop receiving data and instruct the device to cease sending, call listen to register a callback to receive this data.. use isSupported to check if this operation is supported by the characteristic
Constructors
- CharacteristicSubscription(BleCharacteristic _characteristic, CharacteristicProperty _property)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isSupported → bool
-
Indicates whether the characteristic supports the requested subscription type
(notifications or indications).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
listen(
void onData(Uint8List event), {Function? onError, void onDone()?, bool? cancelOnError}) → StreamSubscription - Registers a listener for incoming data from the characteristic.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
subscribe(
{Duration? timeout}) → Future< void> - Subscribes to this characteristic.
-
toString(
) → String -
A string representation of this object.
override
-
unsubscribe(
{Duration? timeout}) → Future< void> - Unsubscribes from this characteristic.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited