123456789101112131415161718192021222324252627282930 |
- #pragma once
- #include "../common/iobuffer.h"
- #include "../common/sensor_socket.h"
- class CMessageQueue;
- class CMqttSensor//:public ISensorNotify
- {
- public:
- CMqttSensor(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;
- };
|