Serial Port for Dart

pub license: LGPL3+

Serial Port for Dart is based on libserialport, which is a minimal C-library created by the sigrok projects, and released under the LGPL3+ license.

Usage

import 'package:dart_serial_port/dart_serial_port.dart';

final name = SerialPort.availablePorts.first;
final port = SerialPort(name);
if (!port.openReadWrite()) {
  print('${SerialPort.lastErrorMessage} ${SerialPort.lastErrorCode}');
  exit(-1);
}

port.write(/* ... */);

final reader = SerialPortReader(port);
reader.stream.listen((data) {
  print('received: $data');
});

To use this package, add dart_serial_port as a dependency in your pubspec.yaml file.

Libraries

dart_serial_port
Introduction [...]