Guide to Implementing Communication Protocols in C
  • Introduction
  • Code Generation vs C++ Library
  • Main Challenges
  • Goal
  • Audience
  • Code Examples
  • Final Outcome
  • Contribution
  • Message
    • Reading and Writing
    • Dispatching and Handling
    • Extending Interface
  • Fields
    • Automating Basic Operations
    • Working With Fields
    • Common Field Types
  • Generic Library
    • Generalising Message Interface
    • Generalising Message Implementation
    • Generalising Fields Implementation
  • Transport
    • PAYLOAD Layer
    • ID Layer
    • SIZE Layer
    • SYNC Layer
    • CHECKSUM Layer
    • Defining Protocol Stack
  • Achievements
  • Appendices
    • Appendix A - tupleForEach
    • Appendix B - tupleAccumulate
    • Appendix C - tupleForEachFromUntil
    • Appendix D - tupleForEachType
    • Appendix E - AlignedUnion
Powered by GitBook
On this page

Was this helpful?

Achievements

After all this effort of creating the generic comms library, let's summarise what has been achieved.

  • The communication protocol implementation becomes easy and straightforward

    process, using mostly declarative statements of classes and types definitions

    without unnecessary boilerplate code. The C++ compiler does all the dirty and

    boring work of generating the required code.

  • The default logic, provided by the library, can easily be extended and/or

    overridden using class inheritance and virtual functions.

  • The protocol implementation doesn't enforce any restrictions on data structures

    being used, and as a result it can be reused in any system, including bare-metal

    ones.

  • There is no dependency on any specific I/O link and the way the data is

    being communicated.

  • The application level messages and transport data are completely independent,

    which allows usage of the same application level messages over different I/O

    links, which require different transport wrapping, at the same time.

PreviousDefining Protocol StackNextAppendices

Last updated 5 years ago

Was this helpful?