From 8d5cad5fecba2a47acb030c49a1d953fe3f4f653 Mon Sep 17 00:00:00 2001 From: hsaturn Date: Thu, 13 May 2021 03:17:54 +0200 Subject: [PATCH] Added overload of Client::publish, fix compilation --- src/TinyMqtt.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/TinyMqtt.h b/src/TinyMqtt.h index e826fdf..b1a1cd3 100644 --- a/src/TinyMqtt.h +++ b/src/TinyMqtt.h @@ -10,11 +10,10 @@ #include #endif #elif defined(ESP32) + #include #ifdef TCP_ASYNC - #include // https://github.com/me-no-dev/AsyncTCP - #else - #include - #endif + #include // https://github.com/me-no-dev/AsyncTCP + #endif #endif #ifdef EPOXY_DUINO #define dbg_ptr uint64_t @@ -177,6 +176,7 @@ class MqttClient // Publish from client to the world MqttError publish(const Topic&, const char* payload, size_t pay_length); + MqttError publish(const Topic& t, const char* payload) { return publish(t, payload, strlen(payload)); } MqttError publish(const Topic& t, const String& s) { return publish(t, s.c_str(), s.length()); } MqttError publish(const Topic& t, const std::string& s) { return publish(t,s.c_str(),s.length());} MqttError publish(const Topic& t) { return publish(t, nullptr, 0);};