libserialport 0.3.0+1 copy "libserialport: ^0.3.0+1" to clipboard
libserialport: ^0.3.0+1 copied to clipboard

Serial Port for Dart (FFI bindings to libserialport, a minimal C-library created by the sigrok).

example/example.dart

import 'package:libserialport/libserialport.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();
  }
}
72
likes
150
points
62
downloads

Publisher

unverified uploader

Weekly Downloads

Serial Port for Dart (FFI bindings to libserialport, a minimal C-library created by the sigrok).

Repository (GitHub)
View/report issues

Documentation

API reference

License

LGPL-3.0 (license)

Dependencies

dylib, ffi

More

Packages that depend on libserialport