Skip to content
No description, website, or topics provided.
C++ CMake
Branch: master
Clone or download
Pull request Compare This branch is 496 commits behind redboltz:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
external
include
test
.gitmodules
.travis.yml
CHANGELOG.md
CMakeLists.txt
Doxyfile
LICENSE_1_0.txt
README.md
appveyor.yml
user-config.jam

README.md

MQTT client/server for C++14 based on Boost.Asio

Version 3.0.0 Build Status Build status

Overview

mqtt_cpp is a header only library. It requires C++14 and the Boost Libraries 1.57.0 or later (See #33).

Add mqtt_cpp/include to your include path. Then, include mqtt_cpp.hpp and/or mqtt_server_cpp.hpp as follows:

For clients:

#include <mqtt_client_cpp.hpp>

For servers:

#include <mqtt_server_cpp.hpp>

You can compile your program as follows:

g++ -std=c++14 -Ipath_to_mqtt_cpp/include -DMQTT_NO_TLS no_tls.cpp -lboost_system -lpthread
g++ -std=c++14 -Ipath_to_mqtt_cpp/include tls.cpp -lboost_system -lssl -lcrypto -lpthread

WebSocket support

If you want to use MQTT on WebSocket, you need to define MQTT_USE_WS macro. mqtt_cpp uses https://github.com/boostorg/beast for WebSocket communication and it requires boost::string_view, so the boost library need to support boost::string_view.

Example

Test

You can build tests and examples as follows:

At mqtt_cpp directory

mkdir build
cd build
cmake ..
make
make test

In order to build tests, you need to prepare the Boost Libraries 1.59.0.

Documents

http://redboltz.github.io/contents/mqtt/index.html

You can create html documents using doxygen.

make doxygen

License

mqtt_cpp is licensed under the Boost Software License, Version 1.0. See the LICENSE_1_0.txt file for details.

You can’t perform that action at this time.