-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
37 lines (33 loc) · 884 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* Copyright (c) 2016, Tino Rusch
*
* This file is released under the terms of the MIT license. You can find the
* complete text in the attached LICENSE file or online at:
*
* http://www.opensource.org/licenses/mit-license.php
*
* @author: Tino Rusch ([email protected])
*/
#include "susi/MQTTClient.h"
#include "susi/BaseApp.h"
class MQTTApp : public Susi::BaseApp {
protected:
std::shared_ptr<Susi::MQTTClient> _mqttComponent;
public:
MQTTApp(int argc, char **argv) : Susi::BaseApp{argc, argv} {}
virtual ~MQTTApp() {}
virtual void start() override {
_mqttComponent.reset(new Susi::MQTTClient{*_susi, _config["component"]});
}
};
int main(int argc, char *argv[]) {
try {
MQTTApp app{argc, argv};
app.start();
app.join();
} catch (const std::exception &e) {
std::cout << e.what() << std::endl;
return 1;
}
return 0;
}