Skip to content

Commit 503147c

Browse files
author
esma
committed
Merge branch 'update_demo' into 'master' (merge request !2)
feat: update config net and dual demo.
2 parents 86795e2 + b1b993d commit 503147c

File tree

135 files changed

+5451
-1935
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+5451
-1935
lines changed

qcloud-llsync-config-net-esp32/components/qcloud_iot_c_sdk/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ if (CONFIG_QCLOUD_IOT_C_SDK)
4444
sdk_src/utils_sha1.c
4545
sdk_src/utils_timer.c
4646
sdk_src/utils_url_download.c
47-
sdk_src/utils_url_upload.c)
47+
sdk_src/utils_url_upload.c
48+
sdk_src/device_bind.c)
4849

4950
list(APPEND srcs
5051
platform/HAL_Airkiss.c

qcloud-llsync-config-net-esp32/components/qcloud_iot_c_sdk/include/exports/qcloud_iot_export_asr.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ typedef struct _RealTimeAsrConf_ {
107107

108108
typedef void (*OnAsrResultCB)(uint32_t request_id, char *res_text, int total_resutl_num, int resutl_seq);
109109

110-
typedef int (*OnAsrResourceEventUsrCallback)(void *pContext, const char *msg, uint32_t msgLen, int event);
110+
typedef int (*OnAsrFileManageEventUsrCallback)(void *pContext, const char *msg, uint32_t msgLen, int event);
111111

112112
/**
113113
* @brief Init asr client
@@ -121,7 +121,7 @@ typedef int (*OnAsrResourceEventUsrCallback)(void *pContext, const char *msg, ui
121121
* @return a valid asr client handle when success, or NULL otherwise
122122
*/
123123
void *IOT_Asr_Init(const char *product_id, const char *device_name, void *pTemplate_client,
124-
OnAsrResourceEventUsrCallback usr_cb);
124+
OnAsrFileManageEventUsrCallback usr_cb);
125125

126126
/**
127127
* @brief Destroy asr client

qcloud-llsync-config-net-esp32/components/qcloud_iot_c_sdk/include/exports/qcloud_iot_export_data_template.h

+17-13
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ extern "C" {
3434
* @brief Data type of template
3535
*/
3636

37-
#define TYPE_TEMPLATE_INT JINT32
38-
#define TYPE_TEMPLATE_ENUM JINT32
39-
#define TYPE_TEMPLATE_FLOAT JFLOAT
40-
#define TYPE_TEMPLATE_BOOL JINT8
41-
#define TYPE_TEMPLATE_STRING JSTRING
42-
#define TYPE_TEMPLATE_TIME JUINT32
43-
#define TYPE_TEMPLATE_JOBJECT JOBJECT
37+
#define TYPE_TEMPLATE_INT JINT32
38+
#define TYPE_TEMPLATE_ENUM JINT32
39+
#define TYPE_TEMPLATE_FLOAT JFLOAT
40+
#define TYPE_TEMPLATE_BOOL JINT8
41+
#define TYPE_TEMPLATE_STRING JSTRING
42+
#define TYPE_TEMPLATE_TIME JUINT32
43+
#define TYPE_TEMPLATE_JOBJECT JOBJECT
44+
#define TYPE_TEMPLATE_STRINGENUM JSTRING
45+
#define TYPE_TEMPLATE_ARRAY JARRAY
4446

4547
typedef int32_t TYPE_DEF_TEMPLATE_INT;
4648
typedef int32_t TYPE_DEF_TEMPLATE_ENUM;
@@ -49,6 +51,8 @@ typedef char TYPE_DEF_TEMPLATE_BOOL;
4951
typedef char TYPE_DEF_TEMPLATE_STRING;
5052
typedef uint32_t TYPE_DEF_TEMPLATE_TIME;
5153
typedef void * TYPE_DEF_TEMPLATE_OBJECT;
54+
typedef char TYPE_DEF_TEMPLATE_STRINGENUM;
55+
typedef char TYPE_DEF_TEMPLATE_ARRAY;
5256

5357
#ifdef EVENT_POST_ENABLED // enable event function of data_template
5458

@@ -82,10 +86,10 @@ typedef struct _sEvent_ {
8286

8387
#endif
8488

85-
typedef enum{
86-
eGET_CTL,
87-
eOPERATION_CTL,
88-
}eControlType;
89+
typedef enum {
90+
eGET_CTL,
91+
eOPERATION_CTL,
92+
} eControlType;
8993
typedef void (*ControlMsgCb)(void *pClient, char *control_str, eControlType type);
9094

9195
/* The structure of data_template init parameters */
@@ -111,8 +115,8 @@ typedef struct {
111115
uint8_t auto_connect_enable; // flag of auto reconnection, 1 is enable and
112116
// recommended
113117

114-
MQTTEventHandler event_handle; // event callback
115-
ControlMsgCb usr_control_handle; // user can register cb to handle control msg instend of sdk's handle
118+
MQTTEventHandler event_handle; // event callback
119+
ControlMsgCb usr_control_handle; // user can register cb to handle control msg instend of sdk's handle
116120
} TemplateInitParams;
117121

118122
#ifdef AUTH_MODE_CERT
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/**
2+
* Tencent is pleased to support the open source community by making IoT Hub available.
3+
* Copyright(C) 2018 - 2021 THL A29 Limited, a Tencent company.All rights reserved.
4+
*
5+
* Licensed under the MIT License(the "License"); you may not use this file except in
6+
* compliance with the License. You may obtain a copy of the License at
7+
* http://opensource.org/licenses/MIT
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is
10+
* distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
11+
* either express or implied. See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
*/
14+
15+
#ifndef QLCOUD_IOT_EXPORT_DEVICE_BIND_H_
16+
#define QLCOUD_IOT_EXPORT_DEVICE_BIND_H_
17+
18+
#ifdef __cplusplus
19+
extern "C" {
20+
#endif
21+
22+
#include "qcloud_iot_export.h"
23+
24+
/**
25+
* @brief Register a callback function to receive the device unbinding message
26+
* sent by the platform.
27+
* before use it you must call qcloud_service_mqtt_init() to sub service topic
28+
*
29+
* @param callback [in] a callback function
30+
* @param context [in] the program context
31+
* @return QCLOUD_RET_SUCCESS for success, or err code for failure
32+
*/
33+
int IOT_Unbind_Device_Register(void *callback, void *context);
34+
/**
35+
* @brief Register a callback function to receive the device unbinding message
36+
* sent by the platform
37+
*
38+
* @param mqtt_client the mqtt client
39+
* @param callback [in] a callback function
40+
* @param context [in] the program context
41+
* @return QCLOUD_RET_SUCCESS for success, or err code for failure
42+
*/
43+
int IOT_Unbind_Device_ByCloud(void *mqtt_client, void *callback, void *context);
44+
/**
45+
* @brief Actively initiate a request to unbind the device to the platform
46+
*
47+
* @param mqtt_client the mqtt client
48+
* @param timeout_ms timeout value (unit: ms) for this operation
49+
* @return QCLOUD_RET_SUCCESS for success, or err code for failure
50+
*/
51+
int IOT_Unbind_Device_Request(void *mqtt_client, int timeout_ms);
52+
53+
#ifdef __cplusplus
54+
}
55+
#endif
56+
57+
#endif // QLCOUD_IOT_EXPORT_DEVICE_BIND_H_

qcloud-llsync-config-net-esp32/components/qcloud_iot_c_sdk/include/exports/qcloud_iot_export_error.h

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ typedef enum {
7575
QCLOUD_ERR_BUF_TOO_SHORT = -119, // MQTT recv buffer not enough
7676
QCLOUD_ERR_MQTT_QOS_NOT_SUPPORT = -120, // MQTT QoS level not supported
7777
QCLOUD_ERR_MQTT_UNSUB_FAIL = -121, // MQTT unsubscribe failed
78+
QCLOUD_ERR_MQTT_RECONNECTING = -122, // MQTT reconnecting
7879

7980
QCLOUD_ERR_JSON_PARSE = -132, // JSON parsing error
8081
QCLOUD_ERR_JSON_BUFFER_TRUNCATED = -133, // JSON buffer truncated

0 commit comments

Comments
 (0)