3 Commits

Author SHA1 Message Date
334fafe132 v1.0.3 2020-08-17 08:51:39 +02:00
730a387f96 Changed includes 2020-08-17 08:49:54 +02:00
213da9e432 Added submodule mqtt++ 2020-08-07 12:11:43 +02:00
5 changed files with 12 additions and 8 deletions

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "lib/mqtt++"]
path = lib/mqtt++
url = https://Julian@git.mueller.haus/mqtt++

View File

@@ -4,15 +4,14 @@ project(thrawn)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS true)
include_directories("/usr/local/include")
include_directories("/usr/local/include/mqttpp-0.1")
link_directories("/usr/local/lib/mqttpp-0.1")
include_directories("lib/mqtt++/include")
find_package(spdlog CONFIG REQUIRED)
find_package(OpenSSL REQUIRED)
include(FindLua)
find_package(lua REQUIRED)
find_package(eclipse-paho-mqtt-c CONFIG REQUIRED)
add_executable(thrawn src/main.cpp src src/thrawn_api.cpp src/Service.cpp src/Cache.cpp src/LuaEngine.cpp)
target_link_libraries(thrawn ${LIBS} spdlog::spdlog ${LUA_LIBRARIES} mqttpp)
add_executable(thrawn src/main.cpp src src/thrawn_api.cpp src/Service.cpp src/Cache.cpp src/LuaEngine.cpp lib/mqtt++/src/mqtt++.cpp)
target_link_libraries(thrawn ${LIBS} spdlog::spdlog ${LUA_LIBRARIES} OpenSSL::SSL eclipse-paho-mqtt-c::paho-mqtt3cs-static)
target_include_directories(thrawn PRIVATE ${LUA_INCLUDE_DIR})
install(TARGETS thrawn DESTINATION bin)

1
lib/mqtt++ Submodule

Submodule lib/mqtt++ added at a7b570ab18

View File

@@ -3,6 +3,6 @@
#define THRAWN_MAJOR_VERSION 1
#define THRAWN_MINOR_VERSION 0
#define THRAWN_PATCH_VERSION 2
#define THRAWN_PATCH_VERSION 3
#endif // VERSION_H

View File

@@ -3,7 +3,6 @@
#include <string>
#include "Service.h"
#include "thrawn_api.h"
#include "mqttpp.h"
#include "spdlog/spdlog.h"
#include "Cache.h"
#include "LuaEngine.h"
@@ -11,6 +10,7 @@
#include "Version.h"
#include <cstring>
#include <thread>
#include "mqtt++.h"
std::vector<std::string> lua_scripts_in_folder(const std::string& path_str) {
std::vector<std::string> scripts;
@@ -35,6 +35,7 @@ int main(int argc, char* argv[]) {
std::string mqttServerURI = "tcp://chimaera:1883";
mqttpp::LastWill last_will {"dev/thrawn/status", "0"};
std::string version_topic = "dev/thrawn/version";
std::string version_topic_value = std::to_string(THRAWN_MAJOR_VERSION) + "." + std::to_string(THRAWN_MINOR_VERSION) + "." + std::to_string(THRAWN_PATCH_VERSION);
std::string lastWillConnected = "1";