Skip to content

klepsydra-technologies/kpsr-tutorial

Repository files navigation

kpsr-tutorial

Public tutorial for using Klepsydra API. It consists of four chapters:

  • Chapter 1 covers the core API of Klepsydra.
    • Annex A covers how to pass a function as a parameter, paying special attention to different lambda function approaches.
    • Annex B covers publisher and subscriber arguments.
  • Chapter 2 covers the ZMQ connection API.
  • Chapter 3 cover the code generator tool. It shows how to create a small application and build up to integrate with middlewares like ZMQ.
  • Chapter 4 covers the state machine.

Each chapter has its corresponding code in the examples' folder. Note, chapter 3 examples for basic code generator are in the core examples/core folder while the location of middleware specific examples is noted in the respective tutorial sections.

Installation Instructions

System dependencies

Note that Google Tests is pulled in automatically when installing this project and does not need separate installation.

Dependencies installed by Klepsydra

No separate installation is needed for the following dependencies if the Klepsydra installation was done correctly.

Klepsydra dependencies

The following dependencies need to be installed:

kpsr-build will be pulled in automatically by the install process of this project.

Installation

sudo apt install build-essential git cmake

Given $KLEPSYDRA_HOME, for example $HOME/klepsydra:

cd $KLEPSYDRA_HOME
git clone https://github.com/klepsydra-technologies/kpsr-tutorial
cd kpsr-tutorial/
git submodule update --init
mkdir build && cd build/
cmake ..
make -j$(nproc)
make test

The cmake has the following options:

  • -DCMAKE_PREFIX_PATH=<path> Klepsydra SDK installation location (/usr/local by default), same as -DCMAKE_INSTALL_PREFIX when building kpsr-core
  • -DKPSR_INSTALL_PATH=<path> to specify where kpsr-tutorial binaries should be installed (/opt/klepsydra by default)
  • -DKPSR_WITH_ZMQ=true for the ZMQ examples

The examples binaries, such as kpsr_tutorial_chapter1_1, are located at build/bin/

License

© 2023 Klepsydra Technologies AG, all rights reserved. Licensed under the terms in LICENSE.md

This software and documentation are 2023 Klepsydra Technologies AG Limited and its licensees. All rights reserved. See license file for full copyright notice and license terms.

Contact

https://www.klepsydra.com [email protected]