Skip to content

Commit

Permalink
Correct an issue with wildcards (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Lapointe committed Nov 17, 2020
1 parent 03e859a commit 8bc3a46
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/SimpleMQTTClient/SimpleMQTTClient.ino
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ 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"
client.publish("mytopic/test", "This is a message"); // You can activate the retain flag by setting the third parameter to true

// 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");
});
}

Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=EspMQTTClient
version=1.11.0
version=1.11.1
author=Patrick Lapointe <patrick.lapointe@hotmail.ca>
maintainer=Patrick Lapointe <patrick.lapointe@hotmail.ca>
sentence=A library that provides a wifi and MQTT connection to an ESP8266/ESP32
Expand Down
2 changes: 1 addition & 1 deletion src/EspMQTTClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8bc3a46

Please sign in to comment.