diff --git a/src/vscp/common/vscp-client-mqtt.cpp b/src/vscp/common/vscp-client-mqtt.cpp index 8fcbe1f84..bc5e04089 100644 --- a/src/vscp/common/vscp-client-mqtt.cpp +++ b/src/vscp/common/vscp-client-mqtt.cpp @@ -623,7 +623,7 @@ vscpClientMqtt::vscpClientMqtt(void) m_bindInterface = ""; // No bind interface m_mosq = nullptr; // No mosquitto connection m_bRun = true; // Run to the Hills... - m_host = "localhost"; // tcp://localhost:1883 + m_host = "localhost"; // mqtt://localhost:1883 m_port = 1883; // Default port m_clientid = ""; // No client id set m_username = ""; // No username set @@ -790,6 +790,16 @@ vscpClientMqtt::initFromJson(const std::string &config) m_bTLS = true; spdlog::debug("VSCP MQTT CLIENT: json mqtt init: Secure connection {}.", m_host); } + else if (0 == m_host.find("mqtt://")) { + m_host = m_host.substr(7); + m_bTLS = false; + spdlog::debug("VSCP MQTT CLIENT: json mqtt init: Unsecure connection {}.", m_host); + } + else if (0 == m_host.find("mqtts://")) { + m_host = m_host.substr(8); + m_bTLS = true; + spdlog::debug("VSCP MQTT CLIENT: json mqtt init: Secure connection {}.", m_host); + } // Get port size_t pos; @@ -1455,7 +1465,7 @@ vscpClientMqtt::initFromJson(const std::string &config) // void -vscpClientMqtt::writeEventDefaultsFromTopic(vscpEvent &ex, const char *pTopic) +vscpClientMqtt::writeEventDefaultsFromTopic(vscpEventEx &ex, const char *pTopic) { // If standard topic format is used, that is // vscp////index/zone/subzone @@ -1576,7 +1586,7 @@ vscpClientMqtt::handleMessage(const struct mosquitto_message *pmsg) return false; } - writeEventDefaultsFromTopic(ex, pMsg->topic); + writeEventDefaultsFromTopic(ex, pmsg->topic); // If callback is defined send event if (isCallbackEvActive()) { @@ -1624,7 +1634,7 @@ vscpClientMqtt::handleMessage(const struct mosquitto_message *pmsg) return false; } - writeEventDefaultsFromTopic(ex, pMsg->topic); + writeEventDefaultsFromTopic(ex, pmsg->topic); // If callback is defined send event if (isCallbackEvActive()) { @@ -1672,7 +1682,7 @@ vscpClientMqtt::handleMessage(const struct mosquitto_message *pmsg) return false; } - writeEventDefaultsFromTopic(ex, pMsg->topic); + writeEventDefaultsFromTopic(ex, pmsg->topic); // If callback is defined send event if (isCallbackEvActive()) { @@ -1722,7 +1732,7 @@ vscpClientMqtt::handleMessage(const struct mosquitto_message *pmsg) return false; } - writeEventDefaultsFromTopic(ex, pMsg->topic); + writeEventDefaultsFromTopic(ex, pmsg->topic); // If callback is defined send event if (isCallbackEvActive()) { diff --git a/src/vscp/common/vscp-client-mqtt.h b/src/vscp/common/vscp-client-mqtt.h index c1ff0a810..7ffa3eaf1 100644 --- a/src/vscp/common/vscp-client-mqtt.h +++ b/src/vscp/common/vscp-client-mqtt.h @@ -357,7 +357,7 @@ class vscpClientMqtt : public CVscpClient { vscp////index/zone/subzone and instructed to do so we can find the GUID, class and type from the topic */ - void writeEventDefaultsFromTopic(vscpEvent &ex, const char *pTopic); + void writeEventDefaultsFromTopic(vscpEventEx &ex, const char *pTopic); /*! Handle incoming message diff --git a/third_party/mongoose b/third_party/mongoose index 2df53c3d2..ef8e7419f 160000 --- a/third_party/mongoose +++ b/third_party/mongoose @@ -1 +1 @@ -Subproject commit 2df53c3d27b9ae54b1c08b6c3c3cc660a49fa4a2 +Subproject commit ef8e7419fa704838f8513fd1c6e99363e5dcc182 diff --git a/third_party/nlohmann b/third_party/nlohmann index a97041a98..606b6347e 160000 --- a/third_party/nlohmann +++ b/third_party/nlohmann @@ -1 +1 @@ -Subproject commit a97041a98fc7436cda3b28fb6e353071829d3f02 +Subproject commit 606b6347edf0758c531abb6c36743e09a4c48a84 diff --git a/third_party/spdlog b/third_party/spdlog index 43dcb3982..f355b3d58 160000 --- a/third_party/spdlog +++ b/third_party/spdlog @@ -1 +1 @@ -Subproject commit 43dcb3982d1cffcf34a8b126cd12ee07b8eaa2d9 +Subproject commit f355b3d58f7067eee1706ff3c801c2361011f3d5