Giter Site home page Giter Site logo

harajune / libserialport.dart Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jpnurmi/libserialport.dart

0.0 0.0 0.0 113 KB

Serial Port for Dart

Home Page: https://pub.dev/packages/libserialport

License: GNU Lesser General Public License v3.0

Dart 100.00%

libserialport.dart's Introduction

Dart FFI bindings to libserialport

pub CI license: LGPL3+

TIP: See also flutter_libserialport for automatic building and deploying of libserialport.

This Dart package is based on libserialport, which is a minimal C-library created by the sigrok project, and released under the LGPL3+ license.

Supported platforms:

  • Linux
  • macOS
  • Windows
  • Android

This package uses dart:ffi to call libserialport's C APIs, which implies that libserialport must be bundled to or deployed with the host application. It can be tedious to build and deploy libserialport on all target platforms, but in case you are building a Flutter app instead of a pure Dart app, there is a ready-made drop-in solution called flutter_libserialport that utilizes Flutter's build system to build and deploy libserialport on all supported platforms:

Usage

import 'package:libserialport/libserialport.dart';

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

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

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

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

libserialport.dart's People

Contributors

jpnurmi avatar coimbra1984 avatar dsthdragon avatar igorkilipenko avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.