Author: Kurt Pattyn.
QtAwsIoT is Qt library that implements a client for Amazon AWS IoT.
- MQTT over secure WebSockets support, including SigV4 token authentication support
- Keep-alive (aka ping)
- Subscribing to topics
- Publishing and receiving messages
- Native MQTT connectivity
Currently only supports MQTT over secure Websockets. - Thing Shadows
- Reconnection and resubscription
- Queuing of messages
- Qt version 5
- CMake v3.5 or higher.
- QtMqtt.
# Check out the sources.
git clone https://github.com/KurtPattyn/QtAwsIoT.git
# Go into the checked out directory
cd QtAwsIoT
# Create build directory
mkdir build
# Go into the build directory
cd build
# Create the build files
cmake -DCMAKE_BUILD_TYPE=debug -DBUILD_SHARED_LIBS=OFF ..
# To make a release build, change `-DCMAKE_BUILD_TYPE=debug` to `-DCMAKE_BUILD_TYPE=release`
# To make a dynamic library, change `-DBUILD_SHARED_LIBS=OFF` to `-DBUILD_SHARED_LIBS=ON`
# Build the library
make
make test
To enable testing of internal code, add
-DPRIVATE_TESTS_ENABLED
(default: OFF) to thecmake
command line.
make install
This will install the library and the headers to
CMAKE_INSTALL_PREFIX
.
CMAKE_INSTALL_PREFIX
defaults to/usr/local
on UNIX/macOS andc:/Program Files
on Windows.
To install in another location, add-DCMAKE_INSTALL_PREFIX="<custom location>"
to thecmake
command line.
Include the following in your CMakeLists.txt
file
find_package(Qt5Core)
find_package(Qt5NetWork)
find_package(Qt5WebSockets)
find_package(Qt5Mqtt)
find_package(Qt5AwsIoT)
target_link_libraries(<target> Qt5::AwsIoT)
In your C++ source file include the QtAwsIoT module
#include <QtAwsIoT>
See the examples
directory for examples how to use this library.
To enable debugging information of QtAwsIoT, the following environment variable can be defined.
QT_LOGGING_RULES="QtAwsIoT.*.debug=true"