qcloud_iot_export.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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_H_
  19. #define QCLOUD_IOT_EXPORT_H_
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. #include "config.h"
  24. #include "platform.h"
  25. /* IoT C-SDK version info */
  26. #define QCLOUD_IOT_DEVICE_SDK_VERSION "3.1.3"
  27. /**************** QCloud IoT C-SDK constants begin ************************/
  28. /* MAX size of client ID */
  29. #define MAX_SIZE_OF_CLIENT_ID (80)
  30. /* MAX size of product ID */
  31. #define MAX_SIZE_OF_PRODUCT_ID (10)
  32. /* MAX size of product secret */
  33. #define MAX_SIZE_OF_PRODUCT_SECRET (32)
  34. /* MAX size of device name */
  35. #define MAX_SIZE_OF_DEVICE_NAME (48)
  36. /* MAX size of device secret */
  37. #define MAX_SIZE_OF_DEVICE_SECRET (64)
  38. /* MAX size of device cert file name */
  39. #define MAX_SIZE_OF_DEVICE_CERT_FILE_NAME (128)
  40. /* MAX size of device key file name */
  41. #define MAX_SIZE_OF_DEVICE_SECRET_FILE_NAME (128)
  42. /* MAX size of region len */
  43. #define MAX_SIZE_OF_REGION (64)
  44. /* MAX num of subdevice */
  45. #define MAX_NUM_SUB_DEV (1)
  46. /**************** QCloud IoT C-SDK constants end *************************/
  47. typedef enum {
  48. eCOMMON_DEV = 0, // common dev
  49. eGW_DEV = 1, // Gateway dev
  50. eGW_SUB_DEV = 2, // sub dev of Gateway
  51. eDEFAULT_DEV
  52. } eDevType;
  53. typedef struct {
  54. char product_id[MAX_SIZE_OF_PRODUCT_ID + 1];
  55. char device_name[MAX_SIZE_OF_DEVICE_NAME + 1];
  56. char client_id[MAX_SIZE_OF_CLIENT_ID + 1];
  57. #ifdef AUTH_MODE_CERT
  58. char dev_cert_file_name[MAX_SIZE_OF_DEVICE_CERT_FILE_NAME + 1];
  59. char dev_key_file_name[MAX_SIZE_OF_DEVICE_SECRET_FILE_NAME + 1];
  60. #else
  61. char device_secret[MAX_SIZE_OF_DEVICE_SECRET + 1];
  62. #endif
  63. #ifdef DEV_DYN_REG_ENABLED
  64. char product_secret[MAX_SIZE_OF_PRODUCT_SECRET + 1];
  65. #endif
  66. char region[MAX_SIZE_OF_REGION];
  67. eDevType dev_type;
  68. } DeviceInfo;
  69. #ifdef GATEWAY_ENABLED
  70. typedef struct {
  71. DeviceInfo gw_info;
  72. DeviceInfo sub_dev_info[MAX_NUM_SUB_DEV];
  73. int sub_dev_num;
  74. } GatewayDeviceInfo;
  75. #endif
  76. #include "qcloud_iot_export_variables.h"
  77. #include "qcloud_iot_export_error.h"
  78. #include "qcloud_iot_export_log.h"
  79. #include "qcloud_iot_export_mqtt.h"
  80. #include "qcloud_iot_export_data_template.h"
  81. #include "qcloud_iot_export_ota.h"
  82. #include "qcloud_iot_export_gateway.h"
  83. #include "qcloud_iot_export_dynreg.h"
  84. #include "qcloud_iot_export_system.h"
  85. #ifdef __cplusplus
  86. }
  87. #endif
  88. #endif /* QCLOUD_IOT_EXPORT_H_ */