EN | RU

Original README

Flutter_libserialport_aurora

flutter_libserialport_aurora is a Flutter plugin that provides cross-platform access to serial port communication through the libserialport C library. The plugin offers FFI integration for Aurora OS devices and implements the functionality of libserialport.

Usage example:

// Get list of available serial ports
final ports = SerialPort.availablePorts;
print('Available ports: $ports');

// Open a serial port
final port = SerialPort('/dev/ttyUSB0');
if (port.openReadWrite()) {
  // Configure the port
  port.config = SerialPortConfig(
    baudRate: 115200,
    bits: 8,
    parity: SerialPortParity.none,
    stopBits: 1,
  );

  // Read data from the port
  final reader = SerialPortReader(port);
  reader.stream.listen((data) {
    print('Received: ${String.fromCharCodes(data)}');
  });

  // Write data to the port
  final writer = SerialPortWriter(port);
  await writer.write([72, 101, 108, 108, 111]); // "Hello"

  // Close the port
  port.close();
}

Contents

Installation and build

Add the plugin depending on the target application in the pubspec.yaml file:

dependencies:
  flutter_libserialport_aurora:
    git:
      url: https://gitlab.com/omprussia/flutter/flutter-plugins/flutter_libserialport_aurora.git
      ref: feature/migrate_3.35.7

And update the dependencies:

flutter-aurora pub get

Detailed description

The plugin implements all the functions of the libserialport plugin with FFI integration for Aurora OS.

Information about branches

The versions of the application comply with the branch naming agreement .

Known errors

No errors observed. Ensure proper permissions for accessing serial ports on target devices.

Compatibility

The application has been working correctly since the 5.0.0 version of the Aurora OS. Required flutter 3.32.7 or newer.

Terms of Use and Participation

The source code of the project is provided under the license, that allows it to be used in third-party applications.

To participate in the development of the project, please read the contributor agreement. If you plan to contribute your own source code to the project, you will need to accept the CLA agreement.

For information about contributors see AUTHORS.

Code of conduct is a current set of rules of the Open Mobile Platform which informs you how we expect the members of the community will interact while contributing and communicating.