#ifndef __MQTTCLIENT_H__ #define __MQTTCLIENT_H__ #include #include class MqttClient { public: static MqttClient *instance(); bool initialize(const std::string &username, const std::string &password); protected: static void eventHandler(void *handler_args, esp_event_base_t base, int32_t event_id, void *event_data); void onConnected(struct esp_mqtt_client *client); void onSetStatus(const char *data, int size); MqttClient() = default; private: std::string m_setStatusTopic; }; #endif // __MQTTCLIENT_H__