subscribeToCharacteristic method

Stream<List<int>> subscribeToCharacteristic(
  1. QualifiedCharacteristic characteristic
)

Subscribes to updates from the characteristic specified.

This stream terminates automatically when the device is disconnected.

This method assumes there is a single characteristic with the ids specified in characteristic. If there are multiple characteristics with the same id on a device, use resolve to find them all. Or use getDiscoveredServices to select the Services and Characteristics you're interested in.

Implementation

Stream<List<int>> subscribeToCharacteristic(QualifiedCharacteristic characteristic) async* {
  yield* (await resolveSingle(characteristic)).subscribe();
}