|
ProtoComm
A modern C++ library for robust, multi-message, multi-channel communication. Manages frame parsing, validation, and sync/async I/O.
|
A header-only modern C++ library designed for message-based communication with hardware or services. Intended for use in applications running on Embedded Linux devices as well as high-performance platforms like PCs, Macs, and smartphones.
ProtoComm can be used in a variety of scenarios, such as a ground station communicating with a rocket, UAV, or drone for real-time data exchange and control.
std::future and callback-based patterns, offering maximum flexibility for both simple, await-style requests and high-performance, continuous, event-driven data streams.asio and Qt.The core ProtoComm library is header-only and has no external dependencies other than a C++20 compliant compiler.
The protocol implementations are optional and require the respective libraries.
Since ProtoComm is a header-only library, the easiest way to use it is to simply copy the core file, ProtoComm.hpp, into your project's include directory.
If you require the asio or Qt implementations, you must also copy their respective header and source files from the library into your project tree and ensure you link against the required dependencies.
Configuration Options
The following options can be toggled:
PROTOCOMM_BUILD_ASIO, for building Asio protocol implementations.PROTOCOMM_BUILD_QT, for building Qt protocol implementations.PROTOCOMM_BUILD_MODULES, for building the C++ modules.PROTOCOMM_BUILD_TESTS, for building library tests.PROTOCOMM_BUILD_EXAMPLES, for building library examples.Example
A collection of examples demonstrating how to implement your own messages, protocols, and frame handlers can be found in the docs/examples directory.
CommStream is optimized for platforms with a full operating system where resources like memory and threads are readily available. A primary goal is to introduce a parallel implementation, CommStreamES, designed for resource-constrained MCUs.
This embedded-friendly version will be built for bare-metal and RTOS environments by adhering to strict embedded C++ guidelines:
std::error_code, to be compatible with compilers using.std::variant instead of prototypes and cloning.Contributions are welcome and greatly appreciated! Please see the Contributing Guidelines for details on how to submit pull requests, report issues, and follow the project's code style.