core_mqtt_config.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2025-06-10 RV the first version
  9. */
  10. #ifndef APPLICATIONS_FIREMQTT_PORT_CONFIG_H_
  11. #define APPLICATIONS_FIREMQTT_PORT_CONFIG_H_
  12. #include "mqtt_api.h"
  13. /* MQTT Broker Address */
  14. #ifndef MQTT_BROKER_ADDRESS
  15. #define MQTT_BROKER_ADDRESS "broker.emqx.io"
  16. #endif
  17. /* MQTT Broker Port */
  18. #ifndef MQTT_BROKER_PORT
  19. #define MQTT_BROKER_PORT 1883
  20. #endif
  21. /* MQTT Client ID */
  22. #ifndef MQTT_CLIENT_ID
  23. #define MQTT_CLIENT_ID "rtthread_mqtt_client"
  24. #endif
  25. /* MQTT Subscription Topic */
  26. #ifndef MQTT_TOPIC_SUB
  27. #define MQTT_TOPIC_SUB "rtthread/test/sub"
  28. #endif
  29. /* MQTT Publish Topic */
  30. #ifndef MQTT_TOPIC_PUB
  31. #define MQTT_TOPIC_PUB "rtthread/test/pub"
  32. #endif
  33. /* MQTT Keep Alive Time (seconds) */
  34. #ifndef MQTT_KEEP_ALIVE
  35. #define MQTT_KEEP_ALIVE 60
  36. #endif
  37. /* MQTT Thread Yield Time */
  38. #ifndef MQTT_LOOP_CNT
  39. #define MQTT_LOOP_CNT 60
  40. #endif
  41. /* MQTT Receive Polling Timeout (milliseconds) */
  42. #ifndef MQTT_RECV_POLLING_TIMEOUT_MS
  43. #define MQTT_RECV_POLLING_TIMEOUT_MS (0U)
  44. #endif
  45. /* MQTT PINGRESP Timeout (milliseconds) */
  46. #ifndef MQTT_PINGRESP_TIMEOUT_MS
  47. #define MQTT_PINGRESP_TIMEOUT_MS (10000U)
  48. #endif
  49. /* MQTT Outgoing Publish Count */
  50. #ifndef MQTT_OUTGOING_PUBLISH_COUNT
  51. #define MQTT_OUTGOING_PUBLISH_COUNT 30
  52. #endif
  53. /* MQTT Buffer Size */
  54. #ifndef MQTT_BUF_SIZE
  55. #define MQTT_BUF_SIZE 4096
  56. #endif
  57. /* Maximum Retry Attempts */
  58. #ifndef MAX_RETRY_ATTEMPTS
  59. #define MAX_RETRY_ATTEMPTS 5
  60. #endif
  61. /* Initial Backoff Time (milliseconds) */
  62. #ifndef INITIAL_BACKOFF_MS
  63. #define INITIAL_BACKOFF_MS 1000
  64. #endif
  65. /* Maximum Backoff Time (milliseconds) */
  66. #ifndef MAX_BACKOFF_MS
  67. #define MAX_BACKOFF_MS 60000
  68. #endif
  69. /* MQTT User Callback */
  70. #ifndef MQTT_USER_CALLBACK
  71. #define MQTT_USER_CALLBACK mqttEventCallback
  72. #endif
  73. #endif /* APPLICATIONS_FIREMQTT_PORT_CONFIG_H_ */