Initial pubsub preparatory work

This commit is contained in:
Alex Hultman
2019-02-09 01:00:17 +01:00
parent aaf1f05dcd
commit f08bc8cd03
4 changed files with 66 additions and 9 deletions
+4 -2
View File
@@ -133,7 +133,9 @@ public:
);
/* Fix this up */
webSocketContextData->topicTree.subscribe(topic, this, nullptr);
bool *valid = new bool;
*valid = true;
webSocketContextData->topicTree.subscribe(std::string(topic), this, valid);
}
/* Publish a message to a topic according to MQTT rules and syntax */
@@ -142,7 +144,7 @@ public:
(us_new_socket_context_t *) us_new_socket_context(SSL, (us_new_socket_t *) this)
);
webSocketContextData->topicTree.publish(topic, message.data(), message.length());
webSocketContextData->topicTree.publish(std::string(topic), (char *) message.data(), message.length());
}
};