qcloud_iot_export_variables.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Tencent is pleased to support the open source community by making IoT Hub
  3. available.
  4. * Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
  5. * Licensed under the MIT License (the "License"); you may not use this file
  6. except in
  7. * compliance with the License. You may obtain a copy of the License at
  8. * http://opensource.org/licenses/MIT
  9. * Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is
  11. * distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  12. KIND,
  13. * either express or implied. See the License for the specific language
  14. governing permissions and
  15. * limitations under the License.
  16. *
  17. */
  18. #ifndef QCLOUD_IOT_EXPORT_VARIABLES_H_
  19. #define QCLOUD_IOT_EXPORT_VARIABLES_H_
  20. /*
  21. * Below variables are dependant on user situation (network status/device
  22. * memory/application context)
  23. * Adjust the default value to meet your requirement
  24. */
  25. /* default MQTT/CoAP timeout value when connect/pub/sub (unit: ms) */
  26. #define QCLOUD_IOT_MQTT_COMMAND_TIMEOUT (5 * 1000)
  27. /* default MQTT keep alive interval (unit: ms) */
  28. #define QCLOUD_IOT_MQTT_KEEP_ALIVE_INTERNAL (240 * 1000)
  29. /* default MQTT Tx buffer size, MAX: 16*1024 */
  30. #define QCLOUD_IOT_MQTT_TX_BUF_LEN (2048)
  31. /* default MQTT Rx buffer size, MAX: 16*1024 */
  32. #define QCLOUD_IOT_MQTT_RX_BUF_LEN (2048)
  33. /* default COAP Tx buffer size, MAX: 1*1024 */
  34. #define COAP_SENDMSG_MAX_BUFLEN (512)
  35. /* default COAP Rx buffer size, MAX: 1*1024 */
  36. #define COAP_RECVMSG_MAX_BUFLEN (512)
  37. /* MAX MQTT reconnect interval (unit: ms) */
  38. #define MAX_RECONNECT_WAIT_INTERVAL (60 * 1000)
  39. /* MAX valid time when connect to MQTT server. 0: always valid */
  40. /* Use this only if the device has accurate UTC time. Otherwise, set to 0 */
  41. #define MAX_ACCESS_EXPIRE_TIMEOUT (0)
  42. /* log print/upload related variables */
  43. /* MAX size of log buffer for one log item including header and content */
  44. #define MAX_LOG_MSG_LEN (511)
  45. #if defined(__linux__)
  46. #undef MAX_LOG_MSG_LEN
  47. #define MAX_LOG_MSG_LEN (1023)
  48. #endif
  49. /*
  50. * Log upload related params, which will affect the size of device memory/disk
  51. * consumption
  52. * the default value can be changed for different user situation
  53. */
  54. // size of buffer for log upload
  55. #define LOG_UPLOAD_BUFFER_SIZE 5000
  56. // Max size of one http log upload. Should not larger than 5000
  57. #define MAX_HTTP_LOG_POST_SIZE 3000
  58. // MAX size for saving log into NVS (files/FLASH) after upload fail
  59. #define MAX_LOG_SAVE_SIZE (3 * LOG_UPLOAD_BUFFER_SIZE)
  60. // interval of log upload (unit: ms) Decrease this value if
  61. // LOG_UPLOAD_BUFFER_SIZE is small
  62. #define LOG_UPLOAD_INTERVAL_MS 2000
  63. #endif /* QCLOUD_IOT_EXPORT_VARIABLES_H_ */