Name Last Update
examples Loading commit data...
scripts Loading commit data...
src Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
CMakeLists.txt Loading commit data...
README.md Loading commit data...
cmake @ 772ec5a466d
versioning @ c4ba3bd6510

README.md

MQTT-CPP

Modern, asynchronous and fast C++ client for paho-mqtt ( paho-c ).

Features:

  • Simple and clean A-synchronous API. ( Connect, publish, subscribe ).
  • Thread-safe. Use multiple topics in multiple threads..
  • Callbacks can be lambdas, class methods, bind expressions, or any [std::function]
  • Fully autonomous reconnecting

Dependencies

The only dependency is to libpaho-mqtt3a.so. CHanges are there is a version for your platform ( Debian, Fedora, CentOS ). Just check your package manager for the correct package-name.

Tutorial

  • Clone this repository : git clone http://gitlab.osdev.nl/open_source/mqtt-cpp.git
    • Change to the repo and run the submodules script : $ cd mqtt-cpp $ scripts/setup_submodules -i This will add the cmake directory and versioning.
    • Create a build directory and start the build. $ mkdir build $ cd build $ cmake ../ $ gmake And you're all set. In build/bin there are two examples, test_mqtt_pu and test_mqtt_sub. Have a broker running, like mosquitto or flashmq capable of accepting anonymous connections. Start the "sub" part and couple of moments later the "pub" part. If all went well, you should see two screens in sync running. One is sending, the other is receiveing.