Skip to content

Latest commit

 

History

History
64 lines (42 loc) · 2.01 KB

README.md

File metadata and controls

64 lines (42 loc) · 2.01 KB

Warning

This library currently does Output Plugs only, i.e. it can publish messages but cannot subscribe/consume!

TODO

  • Demo: Basic MQTT publish working
  • Demo: basic MessagePack serialisation
  • Demo: Get basic MessagePack serialised message into MQTT body
  • Build actual library that can be included from other CPP projects, rather than sitting inside examples folder - using CMake again
  • Merge this project into the monorepo
  • Test out using CMake to import (and/or install?) this library automatically, and document the steps needed for developers to do the same
  • Get receiving (subscribing) working!

Third-party libraries used

Resources

Useful guides for CMake structure

Build process:

Be sure to do git submodule update --init --recursive so that all submodules are on the correct branch, etc.

Then from base_agent/cpp:

  • mkdir build
  • cd build
  • cmake ..
  • cmake --build .

Run examples

  • Full example using Tether Agent instance: build/examples/tether_agent_example
  • Example of MsgPack + MQTT publish only: build/examples/msgpack_publish_example
  • Example of MQTT (string message) publish only: build/examples/publish_example

Install in your own CMake-based project

An example CMakeLists.txt that includes this library and dependent libraries:

cmake_minimum_required(VERSION 3.19)

project(My_TetherAgent)

add_executable(My_TetherAgent src/My_TetherAgent.cpp)
set_property(TARGET My_TetherAgent PROPERTY CXX_STANDARD 11)

add_subdirectory(./libs/tether/base_agent/cpp)
add_subdirectory(./libs/psn-cpp)

target_include_directories(My_TetherAgent PUBLIC ./libs/tether/base_agent/cpp/src)

target_link_libraries(My_TetherAgent PUBLIC TetherAgent msgpackc-cxx)