sys_mqtt.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef SYS_MQTT_H
  2. #define SYS_MQTT_H
  3. #include "ucos_ii.h"
  4. #include "gateway_message.h"
  5. #include "json_queue.h"
  6. #define MBOX_NETWORK_ERROR 0xf0000000
  7. #define MBOX_MQTT_QOS1PUBACK 0x10000001
  8. #define MBOX_MQTT_QOS2PUBREC 0x10000002
  9. #define MBOX_MQTT_QOS2PUBCOMP 0x10000003
  10. #define MBOX_USER_PUBLISHQOS0 0x20000001
  11. #define MBOX_USER_PUBLISHQOS1 0x20000002
  12. #define MBOX_USER_PUBLISHQOS2 0x20000003
  13. #define MQTT_PRINTF printf
  14. //#define MQTT_SERVER_ADDR "192.168.0.116"
  15. //#define MQTT_SERVER_ADDR "192.168.0.183"
  16. //#define MQTT_SERVER_ADDR "36.134.23.11"
  17. //#define MQTT_SERVER_PORT 1883
  18. #define CLIENT_ID "stm32f207DTtest0002"
  19. //#define USER_NAME "emqxxx"
  20. //#define PASSWORD "123456"
  21. //#define USER_NAME NULL
  22. //#define PASSWORD NULL
  23. #define KEEPLIVE_TIME 120
  24. #define MQTT_VERSION 4
  25. //#define TOPICSTM32 "test/stm32"
  26. //#define TOPICPC "test/pc"
  27. //#define TOPICTEST "/device/cxw0817111032"
  28. extern int mqtt_connectFlag;
  29. extern OS_EVENT *mqtt_sendMseeageMbox;
  30. extern OS_EVENT *mqtt_recvMseeageMbox;
  31. extern OS_EVENT *JsonQ;
  32. void mqtt_threadCreate(void);
  33. #define jsonMaxSize 2 * 1024
  34. extern char pubJsonString[jsonMaxSize];
  35. extern char pubJsonStringCopy[jsonMaxSize];
  36. #endif