mqtt_defconfig.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * @Author : jiejie
  3. * @GitHub : https://github.com/jiejieTop
  4. * @Date : 2021-02-26 12:00:24
  5. * @LastEditors : jiejie
  6. * @LastEditTime : 2022-06-15 23:22:10
  7. * @FilePath : /mqttclient/mqttclient/mqtt_defconfig.h
  8. * Copyright (c) 2022 jiejie, All Rights Reserved. Please keep the author information and source code according to the license.
  9. */
  10. /*
  11. * @Author: jiejie
  12. * @Github: https://github.com/jiejieTop
  13. * @Date: 2020-02-25 03:36:09
  14. * @LastEditTime: 2020-06-17 19:59:41
  15. * @Description: the code belongs to jiejie, please keep the author information and source code according to the license.
  16. */
  17. #ifndef _DEFCONFIG_H_
  18. #define _DEFCONFIG_H_
  19. #include "mqtt_config.h"
  20. #ifndef MQTT_LOG_LEVEL
  21. #define MQTT_LOG_LEVEL MQTT_LOG_DEBUG_LEVEL //MQTT_LOG_WARN_LEVEL MQTT_LOG_DEBUG_LEVEL
  22. #endif // !MQTT_LOG_LEVEL
  23. #ifndef MQTT_MAX_PACKET_ID
  24. #define MQTT_MAX_PACKET_ID (0xFFFF - 1)
  25. #endif // !MQTT_MAX_PACKET_ID
  26. #ifndef MQTT_TOPIC_LEN_MAX
  27. #define MQTT_TOPIC_LEN_MAX 64
  28. #endif // !MQTT_TOPIC_LEN_MAX
  29. #ifndef MQTT_ACK_HANDLER_NUM_MAX
  30. #define MQTT_ACK_HANDLER_NUM_MAX 64
  31. #endif // !MQTT_ACK_HANDLER_NUM_MAX
  32. #ifndef MQTT_DEFAULT_BUF_SIZE
  33. #define MQTT_DEFAULT_BUF_SIZE 1024
  34. #endif // !MQTT_DEFAULT_BUF_SIZE
  35. #ifndef MQTT_DEFAULT_CMD_TIMEOUT
  36. #define MQTT_DEFAULT_CMD_TIMEOUT 4000
  37. #endif // !MQTT_DEFAULT_CMD_TIMEOUT
  38. #ifndef MQTT_MAX_CMD_TIMEOUT
  39. #define MQTT_MAX_CMD_TIMEOUT 20000
  40. #endif // !MQTT_MAX_CMD_TIMEOUT
  41. #ifndef MQTT_MIN_CMD_TIMEOUT
  42. #define MQTT_MIN_CMD_TIMEOUT 1000
  43. #endif // !MQTT_MIN_CMD_TIMEOUT
  44. #ifndef MQTT_KEEP_ALIVE_INTERVAL
  45. #define MQTT_KEEP_ALIVE_INTERVAL 100 // unit: second
  46. #endif // !MQTT_KEEP_ALIVE_INTERVAL
  47. #ifndef MQTT_VERSION
  48. #define MQTT_VERSION 4 // 4 is mqtt 3.1.1
  49. #endif // !MQTT_VERSION
  50. #ifndef MQTT_RECONNECT_DEFAULT_DURATION
  51. #define MQTT_RECONNECT_DEFAULT_DURATION 1000
  52. #endif // !MQTT_RECONNECT_DEFAULT_DURATION
  53. #ifndef MQTT_THREAD_STACK_SIZE
  54. #define MQTT_THREAD_STACK_SIZE 4096
  55. #endif // !MQTT_THREAD_STACK_SIZE
  56. #ifndef MQTT_THREAD_PRIO
  57. #define MQTT_THREAD_PRIO 5
  58. #endif // !MQTT_THREAD_PRIO
  59. #ifndef MQTT_THREAD_TICK
  60. #define MQTT_THREAD_TICK 50
  61. #endif // !MQTT_THREAD_TICK
  62. #ifndef MQTT_NETWORK_TYPE_NO_TLS
  63. #ifndef MQTT_TLS_HANDSHAKE_TIMEOUT
  64. #define MQTT_TLS_HANDSHAKE_TIMEOUT (5 * 1000)
  65. #endif // !MQTT_TLS_HANDSHAKE_TIMEOUT
  66. #endif /* MQTT_NETWORK_TYPE_NO_TLS */
  67. #endif /* _DEFCONFIG_H_ */