GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing commschamp.github.io — CommsChampion Ecosystem What it’s all aboutCommsChampion Ecosystem is about easy and compile-time configurable implementation of binary communication protocols using C++11 (and above) programming language, with a main focus on embedded systems (including bare-metal ones). Although the primary purpose of the CommsChampion Ecosystem is to help with the implementation of the binary communication protocols, it can easily be used to encode / decode any binary data as well. Both C++ and embedded systems are first class citizens of the CommsChampion Ecosystem. However, other high level programming languages are also supported via generation of the bindings (glue code) using SWIG and emscripten. Interested? Then buckle up and read on. MotivationAlmost every electronic device/component nowadays has to be able to communicate with other devices, components, or the outside world over some I/O link. Such communication is implemented using various communication protocols, which are notorious for requiring a significant amount of boilerplate code to be written. The implementation of these protocols can be tedious, time-consuming, and error-prone. Therefore, there is a growing tendency among developers to use third-party code generators for data (de)serialization. Usually, such tools receive descriptions of the protocol data structures in separate source file(s) with custom grammar, and generate appropriate (de)serialization code and necessary abstractions to access the data. The main problem with existing tools is that their major purpose is data structure serialization and/or facilitation of remote procedure calls (RPC). The binary data layout and how the transferred data is going to be used are of much lesser importance. Such tools focus on the speed of data serialization and I/O link transfer rather than on safe handling of malformed data, compile-time customization needed by various embedded systems, and significantly reducing the amount of boilerplate code, which needs to be written to integrate generated code into the product’s code base. The binary communication protocols, which may serve as an API or control interface of the device, on the other hand, require a different approach. Their specification puts major emphasis on binary data layout, what values are being transferred (data units, scaling factor, special values, etc.), and how the other end is expected to behave on certain values (what values are considered to be valid and how to behave on reception of invalid values). It requires having some extra meta-information attached to described data structures, which is not sent over the I/O link but still needs to be accessible in the generated code. The existing tools either don’t have means to specify such meta-information (other than in comments) or don’t know what to do with it when provided. As a result, the developer still has to write a significant amount of boilerplate code in order to integrate the generated serialization-focused code to be used in binary communication protocol handling. There is an article called Communication is more than just serialization which provides more detailed examples of the mentioned shortcomings. All available schema-based binary protocol generation solutions have multiple limitations. These include an inability to specify binary data layout or customize data structures used in the generated code. Additionally, they cannot provide or customize polymorphic interfaces to allow the implementation of common code that can work for all message objects. Most available tools lack an ability to customize and/or use multiple transport frames for the same messages, but transferred over different I/O links. Few, if any, allow the injection of manually written code snippets in case the generated code is incomplete and/or incorrect. The generalization is hard. As a result, many embedded C++ developers still have to manually implement the required communication protocols rather than relying on existing tools for code generation. SolutionCommsChampion Ecosystem is designed to address all the problems listed above. Its main purpose is to allow quick and easy implementation of a custom binary protocol, which may already have been defined by a third party, without enforcing any particular data encoding and/or layout. The main philosophy here is that most communication protocols are very similar, but many may have a couple of special nuances, which make it difficult to have an “out of the box” complete solution. The ecosystem allows injection of manually written code snippets, which may replace and/or complement any functionality provided by default. There are multiple parts to the CommsChampion Ecosystem. Some are independent, while others require the use of additional components as well.
The COMMS library was developed to allow quick and easy manual implementation of protocol definitions. However, over the years, it has grown with features and accumulated multiple nuances to remember when defining a new protocol. To simplify protocol definition work, a separate toolset called commsdsl has been developed. It allows much easier and simpler definition of protocols using schema files written in XML-based domain-specific language called CommsDSL. The commsdsl repository provides the following sub-components:
The process of the code generation is depicted below.
Benefits
Extra LibrariesThe CommsChampion Ecosystem also provides several higher-level libraries for managing some widely used open binary communication protocols. These libraries abstract away the protocol messages and provide a convenient and easy-to-use API. All of the provided libraries strive to adhere to the following principles:
The list of currently available protocol handling libraries can be found on the Projects page. More on ToolsCommsChampion Tools are highly versatile applications that, once mastered, become indispensable for protocol development and testing. They offer a wide range of functionalities, including:
Even if the CommsChampion Ecosystem is not used to implement the required protocol messages, with relatively little effort of defining the protocol in terms of CommsDSL schema and then using the provided code generators, the CommsChampion Tools can become robust and valuable internal instrument of the defined protocol debugging. Mastering the CommsChampion EcosystemPlease refer to the Docs page for the available resources and expected order of things to learn and practice. Asking for HelpSome aspects of the CommsChampion Ecosystem may be complex, overwhelming and/or not explained properly in the available documentation. In case of difficulties it is recommended to fork the tutorial project on github and use it as template to create special “tutorial” or “howto” folder (say howto100). In that extra folder try to define minimal portion of the protocol that reproduces the experienced problem. After that please send me an e-mail containing the link to the forked project and the relevant details. I’ll do my best to review it and suggest a solution with the pull-request and/or explaining what needs to change in comments. Other CommunicationFor any technical questions or feature requests that may be relevant to other developers, please consider opening an issue on the relevant project’s repository at github. For any other issue, question or request please send a direct e-mail. It is also recommended to grab RSS feed of the blog to keep yourself updated with latest news. ContributionFor any open and freely available standard protocol you implement using the CommsChampion Ecosystem please consider to open source your definition and implement it as a separate project, use any of the already defined protocols as a template. Please also consider having it hosted as a project inside CommsChampion Ecosystem github organization. You’ll be assigned as an owner and active maintainer of the project. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |