GithubHelp home page GithubHelp logo

mqtt_client_cpp's Introduction

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

Version 1.0.8 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). The only feature that mqtt_cpp uses C++14 is binary literals. e.g.) 0b00001111

You may be able to use mqtt_cpp on C++11 with binary literal extension environment such as g++ and clang++.

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.

mqtt_client_cpp's People

Contributors

faithandbrave avatar maniac103 avatar ogis-nakao avatar redboltz avatar vosst avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.