66e26bc1
Peter M. Groen
Updated dependencies
|
1
|
# MQTT-CPP
|
e0b1fe64
Peter M. Groen
Fixed script.
|
2
3
4
5
|
Modern, asynchronous and fast C++ client for paho-mqtt ( paho-c ).
**Features:**
* Simple and clean A-synchronous API. ( Connect, publish, subscribe ).
|
66e26bc1
Peter M. Groen
Updated dependencies
|
6
|
* Multi-threaded. Use multiple topics in multiple threads..
|
e0b1fe64
Peter M. Groen
Fixed script.
|
7
8
9
10
|
* Callbacks can be lambdas, class methods, bind expressions, or any [std::function]
* Fully autonomous reconnecting
# Dependencies
|
66e26bc1
Peter M. Groen
Updated dependencies
|
11
12
|
This library has dependencies on libpaho-mqtt3a.so and Boost ( RegEx and Core ).
Changes are there is a version for your platform ( Debian, Fedora, CentOS ).
|
e0b1fe64
Peter M. Groen
Fixed script.
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
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.
|
0bf1b2f7
Peter M. Groen
Fixed script.
|
36
37
38
39
40
41
42
43
|
```
Open terminal 1
$ bin/test_mqtt_sub
Open terminal 2
$ bin/test_mqtt_pub
```
|
66e26bc1
Peter M. Groen
Updated dependencies
|
44
|
Screen 2 is sending, Screen 1 is receiving.
|