mqtt_config.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * @Author: jiejie
  3. * @Github: https://github.com/jiejieTop
  4. * @LastEditTime: 2020-06-17 19:31:41
  5. * @Description: the code belongs to jiejie, please keep the author information and source code according to the license.
  6. */
  7. #ifndef _MQTT_CONFIG_H_
  8. #define _MQTT_CONFIG_H_
  9. //#define MQTT_LOG_IS_SALOF
  10. #define MQTT_LOG_LEVEL MQTT_LOG_INFO_LEVEL //MQTT_LOG_WARN_LEVEL MQTT_LOG_DEBUG_LEVEL
  11. #ifdef MQTT_LOG_IS_SALOF
  12. #define SALOF_USING_LOG (1U)
  13. #define SALOF_USING_SALOF (1U)
  14. #define SALOF_LOG_LEVEL MQTT_LOG_LEVEL
  15. #define SALOF_OS SALOF_USING_FREERTOS
  16. #define SALOF_USING_IDLE_HOOK (0U)
  17. #define SALOF_LOG_COLOR (1U)
  18. #define SALOF_LOG_TS (0U)
  19. #define SALOF_LOG_TAR (0U)
  20. #define SALOF_BUFF_SIZE 512
  21. #define SALOF_FIFO_SIZE 4096
  22. #define SALOF_TASK_STACK_SIZE 1024
  23. #define SALOF_TASK_TICK 50
  24. #endif
  25. #define MQTT_MAX_PACKET_ID (0xFFFF - 1)
  26. #define MQTT_TOPIC_LEN_MAX 64
  27. #define MQTT_ACK_HANDLER_NUM_MAX 64
  28. #define MQTT_DEFAULT_BUF_SIZE 2048//1024
  29. #define MQTT_DEFAULT_CMD_TIMEOUT 5000
  30. #define MQTT_MAX_CMD_TIMEOUT 20000
  31. #define MQTT_MIN_CMD_TIMEOUT 5000
  32. #define MQTT_KEEP_ALIVE_INTERVAL 50 // unit: second
  33. #define MQTT_VERSION 4 // 4 is mqtt 3.1.1
  34. #define MQTT_RECONNECT_DEFAULT_DURATION 1000
  35. #define MQTT_THREAD_STACK_SIZE (1*1024)
  36. #define MQTT_THREAD_PRIO 3
  37. #define MQTT_THREAD_TICK 50
  38. #define MQTT_NETWORK_TYPE_NO_TLS
  39. #endif /* _MQTT_CONFIG_H_ */