BluetoothConnection.fromConnectionId constructor

BluetoothConnection.fromConnectionId(
  1. int _id,
  2. String address
)

Implementation

BluetoothConnection.fromConnectionId(this._id, this.address)
    : _readChannel = EventChannel(
          "${MethodChannelFlutterBlueClassic.namespace}/connection/$_id") {
  _readStreamController = StreamController<Uint8List>();

  _readStreamSubscription =
      _readChannel.receiveBroadcastStream().cast<Uint8List>().listen(
            _readStreamController.add,
            onError: _readStreamController.addError,
            onDone: close,
          );

  input = _readStreamController.stream;
  output = BluetoothStreamSink(_id);
}