sys_mqtt.h 1.1 KB

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