Skip to content

DSL schemas parser and code generator for CommsChampion Ecosystem

License

Notifications You must be signed in to change notification settings

mathisloge/commsdsl

 
 

Repository files navigation

Overview

This project is a member of CommsChampion Ecosystem. It provides a code generator that produces C++11 code of a binary communication protocol, defined using CommsDSL schema files.

What's Inside

  • commsdsl2comms - A code generator, that produces C++11 code for binary protocol definition out of CommsDSL schema files. The generated outcome is actually a CMake project that can be used to build and install multiple targets. For details on how to use the tool, please read the commsdsl2comms Manual documentation page. For details on the generated CMake project please read the Generated CMake Project Walkthrough documentation page.
  • libcommsdsl - A C++11 library for parsing of CommsDSL schema files. It can be used to implement independent code generators, which can produce protocol definition code in other programming languages, bindings to the C++ classes generated by the commsdsl2comms, extra testing, etc... NOTE, that at this moment, the library is not documented. Please get in touch in case you need it. I'll let you know when it's going to be ready.

License

Code generated by commsdsl2comms has no license, the vendor is free to pick any as long as it's compatibile with the license(s) of the used componets provided by the comms_champion project:

  • The protocol definition uses the COMMS Library, which is provided under the MPL-2.0 licence. It allows usage in any closed source projects as long as modifications to the COMMS Library itself remain open source.
  • The CommsChampion Tools use open source Qt5 libraries, hence are licensed under the GPLv3. It means that any relevant plugin code must remain open source and is not really available to be used in the closed source commercial products.

The code of this project (libraries and tools it contains) is licensed under Apache v2.0 license.

Examples

There are multiple available examples of protocol definitions that use CommsDSL schema files and commsdsl2comms code generator to generate relevant code.

Synthetic Demo Protocols

  • cc.demo1.commsdsl - Demo protocol to demonstrate definition of various fields as well as simple protocol framing.
  • cc.demo2.commsdsl - Demo protocol to demonstrate protocol versioning, where every message reports protocol version in its transport frame.
  • cc.demo3.commsdsl - Demo protocol to demonstrate protocol versioning, where one "connect" message reports protocol version for all the subsequent messages.

Real Life Open Protocols

  • cc.mqtt311.commsdsl - Defines MQTT v3.1.1 protocol, where message ID shares the same byte with extra flags, that may define existence of the fields in message payload as well as influence how message needs to be processed. The protocol definition also contains snippets of custom code that are injected by the commsdsl2comms into the generated one.
  • cc.mqtt5.commsdsl - Defines MQTT v5 protocol. Similar to v3.1.1, but also adds a heterogeneous list of various properties.
  • cc.mqttsn.commsdsl - Defines MQTT-SN protocol, where field of remaining length of the message can have either 1 or 3 bytes length, depending on the value it contains.
  • cc.ublox.commsdsl - Defines UBX protocol used by various u-blox GPS receivers. The protocol itself is quite complex with hundreds of messages. It uses custom checksum calculation algorithms and injects multiple code snippets to fix incorrect or incomplete functionality available by default.

Tutorial

The cc_tutorial project contains a tutorial on how to use CommsDSL to define the binary protocol, commsdsl2comms to generate code, and COMMS Library to customize and integrate the protocol definition with the business logic of the application.

How to Build

Detailed instructions on how to build and install all the components can be found in doc/BUILD.md file.

Other Documentation

Please check the doc folder for the available additional documentation.

Versioning

This project will use Semantic Versioning, where MAJOR number will be equal to the latest DSL version (The first number of CommsDSL version) it supports. The MINOR number will indicate various improvements in the code of this repository, and PATCH number will indicate various bug fixes.

Supported Compilers

This project (the code generator and CommsDSL parsing library) is implemented using C++14 programming language. As the result, the supported compilers are:

  • GCC: >=5
  • Clang: >=3.9
  • MSVC: >= 2015

The generated project however contains C++11 valid code and supports a bit earlier versions of the compilers:

  • GCC: >=4.8
  • Clang: >=3.8
  • MSVC: >= 2015

Branching Model

This repository will follow the Successful Git Branching Model.

The master branch will always point to the latest release, the development is performed on develop branch. As the result it is safe to just clone the sources of this repository and use it without any extra manipulations of looking for the latest stable version among the tags and checking it out.

Contact Information

For bug reports, feature requests, or any other question you may open an issue here in github or e-mail me directly to: arobenko@gmail.com. I usually respond within 24 hours.

About

DSL schemas parser and code generator for CommsChampion Ecosystem

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 98.2%
  • CMake 1.6%
  • Other 0.2%