#ifndef _MYMQTT_H #define _MYMQTT_H #include #include "config.h" class MyMQTT { public: MyMQTT(void); void connect(void); void subscribe(void); void publish(char* topic, char* payload); void publish(char* topic, String payload); void onMqttConnect(bool sessionPresent); void onMqttMessage(char* topic, char* payload, AsyncMqttClientMessageProperties properties, size_t len, size_t index, size_t total); // static void onMqttMessageWrapper(char* topic, char* payload, AsyncMqttClientMessageProperties properties, size_t len, size_t index, size_t total); static void onMqttConnectWrapper(bool sessionPresent); private: const char* host; const uint32_t port; const char* endpoint; const char* username; const char* password; AsyncMqttClient mqttClient; // static MyMQTT* mqtt_ptr; }; static MyMQTT* mqtt_ptr = nullptr; #endif /* _MYMQTT_H */