mqtt_cpp

基于 Boost.Asio 的 C++14 MQTT 客户端/服务器。「MQTT client/server for C++14 based on Boost.Asio」

  • 所有者: redboltz/mqtt_cpp
  • 平台: Windows,Linux
  • 許可證: Boost Software License 1.0
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

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

Version 8.0.0 Actions StatusBuild Statuscodecov

Important note https://github.com/redboltz/mqtt_cpp/wiki/News.

MQTT v5 is supported since version 4.0.0.

Overview

mqtt_cpp is a header only library. It requires C++14 and the Boost Libraries 1.66.0 or later.

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 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

https://github.com/redboltz/mqtt_cpp/wiki

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.

主要指標

概覽
名稱與所有者redboltz/mqtt_cpp
主編程語言C++
編程語言CMake (語言數: 4)
平台
許可證Boost Software License 1.0
所有者活动
創建於2015-12-06 12:43:23
推送於2024-03-25 13:06:14
最后一次提交2024-03-25 22:05:57
發布數39
最新版本名稱v13.2.1 (發布於 )
第一版名稱v1.0.0 (發布於 )
用户参与
星數460
關注者數21
派生數111
提交數1.6k
已啟用問題?
問題數296
打開的問題數45
拉請求數610
打開的拉請求數6
關閉的拉請求數86
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?