Supported platforms for flutter_libserialport
mainThe flutter_libserialport package supports the following platforms:
- Linux
- macOS
- Windows
- Android
repository·main·Indexed 41 days ago
https://github.com/jpnurmi/flutter_libserialportA Flutter wrapper for the libserialport C-library that simplifies the build and deployment process for the libserialport Dart package. It supports Linux, macOS, Windows, and Android, providing a consistent interface for port enumeration, metadata access, configuration, and data transfer.
The flutter_libserialport package supports the following platforms:
To customize the launch screen for the iOS version of your Flutter application, you can replace the existing image files within the example/ios/Runner/Assets.xcassets/LaunchImage.imageset/ directory with your own assets.
Alternatively, you can manage these assets using Xcode:
open ios/Runner.xcworkspace.Runner/Assets.xcassets.open ios/Runner.xcworkspaceexample directory contains a complete Flutter project demonstrating how to integrate and use the flutter_libserialport plugin. You can run this project to see a working implementation of serial port discovery and communication.To use this package, add flutter_libserialport as a dependency in your pubspec.yaml file. This package acts as a wrapper around the libserialport Dart package, automating the build and deployment of the underlying libserialport C-library so it works out of the box.
dependencies:
flutter_libserialport: ^0.6.0libserialport is a minimal C library designed to abstract OS-specific serial port details. It provides a consistent interface for the following operations across supported platforms:
For non-Windows environments, libserialport uses a GNU-style build system based on autotools. Follow the standard autotools workflow to generate the build system, configure, and compile.
./autogen.sh
./configure
make
make installOn Windows, you can build libserialport using one of two methods:
Important for MSYS2 users:
# Requirements for MSYS2 builds:
# Install: autoconf, automake-wrapper, libtool, make, and either:
# - mingw-w64-i686-gcc (for 32-bit)
# - mingw-w64-x86_64-gcc (for 64-bit)The following C programs demonstrate various usage patterns for libserialport:
list_ports.c: Displays a list of available ports on the system.port_info.c: Displays detailed information about a specific port.port_config.c: Demonstrates how to set and display configuration settings on a port.send_receive.c: Performs a loopback test by sending and receiving data on one or two ports.await_events.c: Demonstrates how to await receive events on multiple ports simultaneously.handle_errors.c: Shows how to handle errors returned by the library.You can build the provided example programs using several methods depending on your environment:
If you have make, gcc, pkg-config, and libserialport installed, run:
makeNote: If the build fails, you may need to modify the Makefile or update your environment paths to ensure pkg-config can locate libserialport.
Open examples.sln in Microsoft Visual Studio 2019 to build libserialport and all example programs.
To build manually, ensure that:
libserialport.h header is available in your include path.libserialport library is available to link during compilation and to run at runtime.