A lightweight, cross-platform C++ library for serial communication that works on Windows, Linux, and macOS.
- Cross-platform: Single codebase for Windows, Linux, and macOS
- Simple API: Easy-to-use interface for serial communication
- Auto-detection: Automatically find and connect to available serial ports
- Manual connection: Connect to specific ports with custom baud rates
- Header-only ready: Minimal dependencies
- CMake 3.10 or higher
- C++17 compatible compiler
- Windows: Visual Studio 2017+ or MinGW
- Linux: GCC 7+ or Clang 5+
- macOS: Xcode 9+ or Clang 5+
Make sure you have CMake installed on your system:
- Windows: Download from cmake.org or use
choco install cmake - Linux:
sudo apt-get install cmake(Ubuntu/Debian) orsudo yum install cmake(CentOS/RHEL) - macOS:
brew install cmakeor download from cmake.org
After cloning, you can build the project with cmake. You must initialize all subomdules after the inital clone or the build will fail:
git submodule update --init --recursiveThen
cmake -B build
cmake --build build-
Permission denied (Linux/macOS)
# Add user to dialout group (Linux) sudo usermod -a -G dialout $USER # Log out and back in, or run: newgrp dialout
-
Port not found
- Check if device is properly connected
- Verify port name is correct for your platform
- Try using
autoconnect()to find available ports
-
Build errors
- Ensure CMake version is 3.10 or higher
- Check that C++17 compiler is available
- On Windows, make sure you have Visual Studio or MinGW installed