Fix compilation

This commit is contained in:
hsaturn
2021-04-02 19:57:04 +02:00
parent e1a936e081
commit 3ed5874373

View File

@@ -131,6 +131,8 @@ class MqttClient
bool connected() { return bool connected() { return
(parent!=nullptr and client==nullptr) or (parent!=nullptr and client==nullptr) or
(client and client->connected()); } (client and client->connected()); }
void write(const char* buf, size_t length)
{ if (client) client->write(buf, length); }
const std::string& id() const { return clientId; } const std::string& id() const { return clientId; }
void id(std::string& new_id) { clientId = new_id; } void id(std::string& new_id) { clientId = new_id; }
@@ -176,8 +178,6 @@ class MqttClient
private: private:
MqttError sendTopic(const Topic& topic, MqttMessage::Type type, uint8_t qos); MqttError sendTopic(const Topic& topic, MqttMessage::Type type, uint8_t qos);
void resubscribe(); void resubscribe();
void write(const char* buf, size_t length)
{ if (client) client->write(buf, length); }
friend class MqttBroker; friend class MqttBroker;
MqttClient(MqttBroker* parent, WiFiClient& client); MqttClient(MqttBroker* parent, WiFiClient& client);