subscribeCharacteristic method

  1. @override
Stream<Uint8List> subscribeCharacteristic(
  1. String address,
  2. String service,
  3. String characteristic
)
override

Implementation

@override
Stream<Uint8List> subscribeCharacteristic(
    String address, String service, String characteristic) async* {
  final channelName =
      await methodChannel.invokeMethod('subscribeCharacteristic', {
    'id': address,
    'service': service,
    'characteristic': characteristic,
  });
  yield* EventChannel(channelName)
      .receiveBroadcastStream()
      .map((event) => event as Uint8List);
}