#pragma once #include "../common/iobuffer.h" #include "../common/sensor_socket.h" class CMessageQueue; class CDataMqttSensor//:public ISensorNotify { public: CDataMqttSensor(CMessageQueue* q); void SetSensorMQTT(MQTTAsync mqClient,std::string Esn); void Stop(const char* _Esn); static MQTTAsync_responseOptions opts; static MQTTAsync m_mqttClient; static bool _run; static char** subTopic; static std::string _Esn; static void Disconnect(void* context, char* cause); //���ӶϿ�callback static int RecevieMessage(void* context, char* pubTopic, int topicLen, MQTTAsync_message* message); static void onConnectFailure(void* context, MQTTAsync_failureData* response); //����ʧ��callback static void onConnectCallCBack(void* context, char* cause); //���ӳɹ�callback static void sendMessage(char* data, int qos, const char* pubTopic); private: CMessageQueue* _message; };