inputStream property

Stream<Uint8List> inputStream

returns the asynchronous input stream.

Example

UsbPort port = await device.create();
await port.open();
port.inputStream.listen( (Uint8List data) { print(data); } );

This will print out the data as it arrives from the uart.

Implementation

Stream<Uint8List> get inputStream {
  if (_inputStream == null) {
    _inputStream = _eventChannel
        .receiveBroadcastStream()
        .map<Uint8List>((value) => value);
  }
  return _inputStream;
}