mqtta.h 610 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef __MOZIT_MQTT_H
  2. #define __MOZIT_MQTT_H
  3. #include <stdio.h>
  4. #include <unistd.h>
  5. #include <stdlib.h>
  6. #include <string.h>
  7. #include "MQTTAsync.h"
  8. #include "../include/globle.h"
  9. #include "../include/debug.h"
  10. //初始化 mqtt 实例的函数
  11. int init_mqtt_client(void);
  12. // 消息发送函数
  13. int my_mqqta_sendmsg(char *topicName, MQTTAsync_message *pubmsg);
  14. // 订阅 单条 topic
  15. int my_subsribe_topic(char * topic,int qos);
  16. //取消订阅 单条topicname
  17. int my_unsubsribe_topic(char * topic,int qos);
  18. //断线重连
  19. void myReconnctMQTT(void *contxt);
  20. #endif /* #ifndef __MOZIT_MQTT_H */