From 51dabb705fd71dd8fc3f0557302bd3e260d21689 Mon Sep 17 00:00:00 2001 From: kasedy Date: Sun, 17 May 2020 14:02:00 -0700 Subject: [PATCH] Fix MqttPubSub Constructor * Fix MqttPubSub constructor * Add MQTT client accessor to MqttConnector --- lib/framework/MqttPubSub.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/framework/MqttPubSub.h b/lib/framework/MqttPubSub.h index 87490f3..88af8af 100644 --- a/lib/framework/MqttPubSub.h +++ b/lib/framework/MqttPubSub.h @@ -21,6 +21,9 @@ class MqttConnector { } virtual void onConnect() = 0; + +public: + inline AsyncMqttClient* getMqttClient() const { return _mqttClient; } }; template @@ -141,8 +144,8 @@ class MqttPubSub : public MqttPub, public MqttSub { String pubTopic = "", String subTopic = "") : MqttConnector(statefulService, mqttClient), - MqttPub(jsonSerializer, statefulService, mqttClient, pubTopic = ""), - MqttSub(jsonDeserializer, statefulService, mqttClient, subTopic = "") { + MqttPub(jsonSerializer, statefulService, mqttClient, pubTopic), + MqttSub(jsonDeserializer, statefulService, mqttClient, subTopic) { } public: