From 8bc3a464c6749cbf318c4d672720f9502685405f Mon Sep 17 00:00:00 2001 From: Patrick Lapointe Date: Tue, 17 Nov 2020 18:14:49 -0500 Subject: [PATCH] Correct an issue with wildcards (#71) --- examples/SimpleMQTTClient/SimpleMQTTClient.ino | 4 ++-- library.json | 2 +- library.properties | 2 +- src/EspMQTTClient.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/SimpleMQTTClient/SimpleMQTTClient.ino b/examples/SimpleMQTTClient/SimpleMQTTClient.ino index 6fafc31..baa66c5 100644 --- a/examples/SimpleMQTTClient/SimpleMQTTClient.ino +++ b/examples/SimpleMQTTClient/SimpleMQTTClient.ino @@ -38,7 +38,7 @@ void onConnectionEstablished() // Subscribe to "mytopic/wildcardtest/#" and display received message to Serial client.subscribe("mytopic/wildcardtest/#", [](const String & topic, const String & payload) { - Serial.println(topic + ": " + payload); + Serial.println("(From wildcard) topic: " + topic + ", payload: " + payload); }); // Publish a message to "mytopic/test" @@ -46,7 +46,7 @@ void onConnectionEstablished() // Execute delayed instructions client.executeDelayed(5 * 1000, []() { - client.publish("mytopic/test", "This is a message sent 5 seconds later"); + client.publish("mytopic/wildcardtest/test123", "This is a message sent 5 seconds later"); }); } diff --git a/library.json b/library.json index 32d8f62..dde43af 100644 --- a/library.json +++ b/library.json @@ -13,7 +13,7 @@ "type": "git", "url": "https://github.com/plapointe6/EspMQTTClient.git" }, - "version": "1.11.0", + "version": "1.11.1", "frameworks": "arduino", "platforms": ["espressif8266", "espressif32"], "dependencies": [ diff --git a/library.properties b/library.properties index a7dfdcb..fb283ee 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=EspMQTTClient -version=1.11.0 +version=1.11.1 author=Patrick Lapointe maintainer=Patrick Lapointe sentence=A library that provides a wifi and MQTT connection to an ESP8266/ESP32 diff --git a/src/EspMQTTClient.cpp b/src/EspMQTTClient.cpp index 2dabcc9..3ad36ac 100644 --- a/src/EspMQTTClient.cpp +++ b/src/EspMQTTClient.cpp @@ -450,7 +450,7 @@ bool EspMQTTClient::subscribe(const String &topic, MessageReceivedCallback messa bool EspMQTTClient::subscribe(const String &topic, MessageReceivedCallbackWithTopic messageReceivedCallback, uint8_t qos) { - if(subscribe(topic, (MessageReceivedCallback)NULL), qos) + if(subscribe(topic, (MessageReceivedCallback)NULL, qos)) { _topicSubscriptionList[_topicSubscriptionList.size()-1].callbackWithTopic = messageReceivedCallback; return true;