dart_serial_port 0.1.0+1 dart_serial_port: ^0.1.0+1 copied to clipboard
Serial Port for Dart (FFI bindings to libserialport, a minimal C-library created by the sigrok).
import 'package:dart_serial_port/dart_serial_port.dart';
// ignore_for_file: avoid_print
void main() {
print('Available ports:');
var i = 0;
for (final name in SerialPort.availablePorts) {
final sp = SerialPort(name);
print('${++i}) $name');
print('\tDescription: ${sp.description}');
print('\tManufacturer: ${sp.manufacturer}');
print('\tSerial Number: ${sp.serialNumber}');
print('\tProduct ID: 0x${sp.productId!.toRadixString(16)}');
print('\tVendor ID: 0x${sp.vendorId!.toRadixString(16)}');
sp.dispose();
}
}