uiot_export.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (C) 2012-2019 UCloud. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License").
  5. * You may not use this file except in compliance with the License.
  6. * A copy of the License is located at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * or in the "license" file accompanying this file. This file is distributed
  11. * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  12. * express or implied. See the License for the specific language governing
  13. * permissions and limitations under the License.
  14. */
  15. #ifndef C_SDK_UIOT_EXPORT_H_
  16. #define C_SDK_UIOT_EXPORT_H_
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. /* MQTT心跳消息发送周期, 单位:s */
  21. #define UIOT_MQTT_KEEP_ALIVE_INTERNAL (240)
  22. /* MQTT 阻塞调用(包括连接, 订阅, 发布等)的超时时间 */
  23. #define UIOT_MQTT_COMMAND_TIMEOUT (5 * 1000)
  24. /* 接收到 MQTT 包头以后,接收剩余长度及剩余包,最大延迟等待时延 */
  25. #define UIOT_MQTT_MAX_REMAIN_WAIT_MS (2000)
  26. /* MQTT消息发送buffer大小, 支持最大256*1024 */
  27. #define UIOT_MQTT_TX_BUF_LEN (2048)
  28. /* MQTT消息接收buffer大小, 支持最大256*1024 */
  29. #define UIOT_MQTT_RX_BUF_LEN (2048)
  30. /* 重连最大等待时间 */
  31. #define MAX_RECONNECT_WAIT_INTERVAL (60 * 1000)
  32. /* 使能无限重连,0表示超过重连最大等待时间后放弃重连,
  33. * 1表示超过重连最大等待时间后以固定间隔尝试重连*/
  34. #define ENABLE_INFINITE_RECONNECT 1
  35. /* MQTT连接域名 */
  36. #define UIOT_MQTT_DIRECT_DOMAIN "mqtt-cn-sh2.iot.ucloud.cn" //"pre-mqtt.iot.ucloud.cn"
  37. #include "uiot_export_mqtt.h"
  38. #include "uiot_defs.h"
  39. #ifdef __cplusplus
  40. }
  41. #endif
  42. #endif /* C_SDK_UIOT_EXPORT_H_ */