mqtt_opts.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /**
  2. * @file
  3. * MQTT client options
  4. */
  5. /*
  6. * Copyright (c) 2016 Erik Andersson
  7. * All rights reserved.
  8. *
  9. * Redistribution and use in source and binary forms, with or without modification,
  10. * are permitted provided that the following conditions are met:
  11. *
  12. * 1. Redistributions of source code must retain the above copyright notice,
  13. * this list of conditions and the following disclaimer.
  14. * 2. Redistributions in binary form must reproduce the above copyright notice,
  15. * this list of conditions and the following disclaimer in the documentation
  16. * and/or other materials provided with the distribution.
  17. * 3. The name of the author may not be used to endorse or promote products
  18. * derived from this software without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
  21. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  22. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
  23. * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  24. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
  25. * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  26. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  27. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  28. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  29. * OF SUCH DAMAGE.
  30. *
  31. * This file is part of the lwIP TCP/IP stack.
  32. *
  33. * Author: Erik Andersson
  34. *
  35. */
  36. #ifndef LWIP_HDR_APPS_MQTT_OPTS_H
  37. #define LWIP_HDR_APPS_MQTT_OPTS_H
  38. #include "lwip/opt.h"
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42. /**
  43. * @defgroup mqtt_opts Options
  44. * @ingroup mqtt
  45. * @{
  46. */
  47. /**
  48. * Output ring-buffer size, must be able to fit largest outgoing publish message topic+payloads
  49. */
  50. #ifndef MQTT_OUTPUT_RINGBUF_SIZE
  51. #define MQTT_OUTPUT_RINGBUF_SIZE 256
  52. #endif
  53. /**
  54. * Number of bytes in receive buffer, must be at least the size of the longest incoming topic + 8
  55. * If one wants to avoid fragmented incoming publish, set length to max incoming topic length + max payload length + 8
  56. */
  57. #ifndef MQTT_VAR_HEADER_BUFFER_LEN
  58. #define MQTT_VAR_HEADER_BUFFER_LEN 128
  59. #endif
  60. /**
  61. * Maximum number of pending subscribe, unsubscribe and publish requests to server .
  62. */
  63. #ifndef MQTT_REQ_MAX_IN_FLIGHT
  64. #define MQTT_REQ_MAX_IN_FLIGHT 4
  65. #endif
  66. /**
  67. * Seconds between each cyclic timer call.
  68. */
  69. #ifndef MQTT_CYCLIC_TIMER_INTERVAL
  70. #define MQTT_CYCLIC_TIMER_INTERVAL 5
  71. #endif
  72. /**
  73. * Publish, subscribe and unsubscribe request timeout in seconds.
  74. */
  75. #ifndef MQTT_REQ_TIMEOUT
  76. #define MQTT_REQ_TIMEOUT 30
  77. #endif
  78. /**
  79. * Seconds for MQTT connect response timeout after sending connect request
  80. */
  81. #ifndef MQTT_CONNECT_TIMOUT
  82. #define MQTT_CONNECT_TIMOUT 100
  83. #endif
  84. /**
  85. * @}
  86. */
  87. #ifdef __cplusplus
  88. }
  89. #endif
  90. #endif /* LWIP_HDR_APPS_MQTT_OPTS_H */