mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-03 20:04:58 +00:00
made cmakelists and edited ip adress
This commit is contained in:
15
src/C++/Socket/CMakeLists.txt
Normal file
15
src/C++/Socket/CMakeLists.txt
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
|
|
||||||
|
# Find the Paho MQTT C++ library
|
||||||
|
find_library(PAHO_MQTTPP_LIBRARY paho-mqttpp3 PATHS /usr/local/lib)
|
||||||
|
find_library(PAHO_MQTT_LIBRARY paho-mqtt3a PATHS /usr/local/lib)
|
||||||
|
|
||||||
|
# Include the headers
|
||||||
|
include_directories(/usr/local/include)
|
||||||
|
|
||||||
|
# Add the executable
|
||||||
|
add_executable(my_program main.cpp)
|
||||||
|
|
||||||
|
# Link the libraries
|
||||||
|
target_link_libraries(my_program ${PAHO_MQTTPP_LIBRARY} ${PAHO_MQTT_LIBRARY})
|
@@ -3,7 +3,7 @@
|
|||||||
#include <thread> // Voor std::this_thread::sleep_for
|
#include <thread> // Voor std::this_thread::sleep_for
|
||||||
#include <chrono> // Voor std::chrono::seconds
|
#include <chrono> // Voor std::chrono::seconds
|
||||||
|
|
||||||
const std::string ADDRESS("mqtt://ishakpi.ddns.net:1883"); // Aanpassen indien nodig
|
const std::string ADDRESS("mqtt://localhost:1883"); // Aanpassen indien nodig
|
||||||
const std::string CLIENT_ID("raspberry_pi_client");
|
const std::string CLIENT_ID("raspberry_pi_client");
|
||||||
const std::string TOPIC("home/commands");
|
const std::string TOPIC("home/commands");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user