Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

String concatenation does not add '0円', causing an error during OTA running #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Yangyuanxin wants to merge 39 commits into TencentCloud:master
base: master
Choose a base branch
Loading
from Yangyuanxin:master
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
0584302
1. 增加设备动态注册功能。
May 15, 2019
452a91b
1. 修改各Sample设备信息获取方式为设备信息HAL层接口实现。
May 15, 2019
6de2b00
1. 基于影子增加数据模板功能。
May 16, 2019
f6cb325
修改readme,增加文档目录docs及物联网开发平台.md
May 16, 2019
6d26cef
调整文档目录
May 17, 2019
2536d89
update readme
May 30, 2019
a4a6a7e
1. MQTT增加subscribe的event handler,及时通知subscribe状态,可解决log及sys主题在destroy...
spikelin Jun 10, 2019
75b9f02
v3.0.1发布
spikelin Jun 11, 2019
76fe477
1. 数据模板字符串类型支持json类型。
Jul 17, 2019
f757f37
update SDK version
Jul 17, 2019
50e1926
优化数据模板相关示例
Jul 18, 2019
ef3263b
1. OTA支持断点续传。
Aug 9, 2019
7b9c241
Corrected the typo in the template
twowinter Aug 23, 2019
13cc46c
1. 修正http接收的超时判断。
Aug 26, 2019
758c48e
delete all old SDK files
Sep 19, 2019
4f3306c
v3.1.0 C-SDK refactor
Sep 19, 2019
e517183
update document and delete garbled
Sep 24, 2019
d62a536
v3.1.1
Oct 10, 2019
79a95e2
1. 修复OTA内存泄漏
Nov 11, 2019
8ae3ff8
v3.1.2
Nov 11, 2019
213b1a9
fix Windows time format error
Nov 11, 2019
f4553ad
update document about topic forward
spikelin Nov 25, 2019
c1f61a6
fix: 消除编译警告
caodj Nov 29, 2019
e2ef5e0
统一代码缩进风格
spikelin Mar 5, 2020
af362aa
C-SDK v3.1.3
spikelin Mar 5, 2020
60a1419
fix some potential bugs
spikelin Mar 6, 2020
dd9fb78
fix coap running bug
Apr 7, 2020
2ed2231
Merge pull request #25 from caodj/master
spikelin Apr 27, 2020
af25f2e
Merge pull request #23 from twowinter/master
spikelin Apr 27, 2020
33118e9
v3.2.0
Apr 30, 2020
f800546
1. fix bugs of OTA reload and HTTP download
Jun 23, 2020
e398ffa
C-SDK v3.2.1
Aug 4, 2020
7ffb37c
fix Windows build error
Aug 4, 2020
0d2c305
fix build error of AT socket
Oct 13, 2020
5381d0e
v3.2.2
Oct 14, 2020
2616003
v3.2.3
spikelin Nov 3, 2020
df06a4b
fix reply puback/pubrec timer expired issue
spikelin Dec 4, 2020
4afac4f
fix socket close error
spikelin Feb 22, 2022
bbc4748
Fixed the error in the return format when compiling and running in Mi...
Yangyuanxin Aug 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
统一代码缩进风格
  • Loading branch information
spikelin committed Mar 5, 2020
commit e2ef5e0270d35bf8f8f95d0464cf6409325ebe66
44 changes: 22 additions & 22 deletions include/exports/qcloud_iot_export_coap.h
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ typedef void (*OnRespCallback)(void *message, void *userContext);
* CoAP EVENT TYPE
*/
typedef enum {
COAP_EVENT_RECEIVE_ACK = 0,// MSG ACK received
COAP_EVENT_RECEIVE_ACK = 0,// MSG ACK received

COAP_EVENT_RECEIVE_RESPCONTENT = 1,// MSG response received
COAP_EVENT_RECEIVE_RESPCONTENT = 1,// MSG response received

COAP_EVENT_UNAUTHORIZED = -1,// Device auth failed or token expired
COAP_EVENT_UNAUTHORIZED = -1,// Device auth failed or token expired

COAP_EVENT_FORBIDDEN = -2,// CoAP URI invalid or without permission
COAP_EVENT_FORBIDDEN = -2,// CoAP URI invalid or without permission

COAP_EVENT_INTERNAL_SERVER_ERROR = -3,// CoAP server error
COAP_EVENT_INTERNAL_SERVER_ERROR = -3,// CoAP server error

COAP_EVENT_ACK_TIMEOUT = -4,// MSG ACK timeout
COAP_EVENT_ACK_TIMEOUT = -4,// MSG ACK timeout

COAP_EVENT_SEPRESP_TIMEOUT = -5,// MSG response timeout
COAP_EVENT_SEPRESP_TIMEOUT = -5,// MSG response timeout
} CoAPEventType;

typedef struct {
Expand All @@ -71,11 +71,11 @@ typedef struct {
* @brief CoAP data structure when sending msg
*/
typedef struct {
bool need_resp;// Need response from peer (true), or not (false). Currently only false is supported
char *pay_load; // COAP msg payload
size_t pay_load_len; // COAP msg payload length
void*user_context;// user context for callback
OnRespCallback resp_callback;// function callback when recv msg response, valid only when need_resp is true
bool need_resp;// Need response from peer (true), or not (false). Currently only false is supported
char *pay_load; // COAP msg payload
size_t pay_load_len; // COAP msg payload length
void*user_context;// user context for callback
OnRespCallback resp_callback;// function callback when recv msg response, valid only when need_resp is true
} SendMsgParams;

#define DEFAULT_SENDMSG_PARAMS {false, NULL, 0, NULL, NULL}
Expand All @@ -95,7 +95,7 @@ typedef struct {
char *device_secret; // device secret
#endif

uint32_tcommand_timeout; // coap timeout value when waiting for ACK/response
uint32_tcommand_timeout; // coap timeout value when waiting for ACK/response

unsigned char max_retry_count; // CoAP max sending retry count

Expand All @@ -104,9 +104,9 @@ typedef struct {
} CoAPInitParams;

#ifdef AUTH_MODE_CERT
#define DEFAULT_COAPINIT_PARAMS { NULL, NULL, NULL, NULL, 2000, 5, {0}}
#define DEFAULT_COAPINIT_PARAMS { NULL, NULL, NULL, NULL, 2000, 5, {0}}
#else
#define DEFAULT_COAPINIT_PARAMS { NULL, NULL, NULL, 2000, 5, {0}}
#define DEFAULT_COAPINIT_PARAMS { NULL, NULL, NULL, 2000, 5, {0}}
#endif

/**
Expand Down Expand Up @@ -138,9 +138,9 @@ int IOT_COAP_Yield(void *pClient, uint32_t timeout_ms);
/**
* @brief Send/publish CoAP msg
*
* @param pClient COAPClient pointer
* @param topicName CoAP URI (msg topic)
* @param sendParams Tx msg parameters
* @param pClient COAPClient pointer
* @param topicName CoAP URI (msg topic)
* @param sendParams Tx msg parameters
* @return value > 0 for msg Id; value < 0 for failure
*/
int IOT_COAP_SendMessage(void *pClient, char *topicName, SendMsgParams *sendParams);
Expand All @@ -156,9 +156,9 @@ int IOT_COAP_GetMessageId(void *pMessage);
/**
* @brief Get COAP Response payload
*
* @param pMessage COAP Response msg
* @param payload msg payload
* @param payloadLen msg payload length
* @param pMessage COAP Response msg
* @param payload msg payload
* @param payloadLen msg payload length
* @return QCLOUD_RET_SUCCESS when success, otherwise fail
*/
int IOT_COAP_GetMessagePayload(void *pMessage, char **payload, int *payloadLen);
Expand All @@ -167,7 +167,7 @@ int IOT_COAP_GetMessagePayload(void *pMessage, char **payload, int *payloadLen
* @brief Get COAP Response msg error code
*
* @param pMessage COAP Response msg
* @return COAPEventType converted from msg error code
* @return COAPEventType converted from msg error code
*/
int IOT_COAP_GetMessageCode(void *pMessage);

Expand Down
4 changes: 2 additions & 2 deletions include/exports/qcloud_iot_export_dynreg.h
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
*/

#ifndef QLCOUD_IOT_EXPORT_DYNREG_H_
#ifndef QLCOUD_IOT_EXPORT_DYNREG_H_
#define QLCOUD_IOT_EXPORT_DYNREG_H_

#ifdef __cplusplus
Expand All @@ -23,7 +23,7 @@ extern "C" {
#include "qcloud_iot_export.h"

/**
* @brief Do dynamic register/create device
* @brief Do dynamic register/create device
*
* @param pDevInfo In: device info with [ProductId, ProductKey, DeviceName]
* Out: device info with [ProductId, DeviceName, DeviceSecret or Device cert/key file]
Expand Down
8 changes: 4 additions & 4 deletions include/exports/qcloud_iot_export_error.h
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ typedef enum {
QCLOUD_RET_MQTT_RECONNECTED = 1, // Reconnected with MQTT server successfully

QCLOUD_RET_SUCCESS = 0, // Successful return

QCLOUD_ERR_FAILURE = -1001, // Generic failure return
QCLOUD_ERR_INVAL = -1002, // Invalid parameter
QCLOUD_ERR_DEV_INFO = -1003, // Fail to get device info
Expand Down Expand Up @@ -76,7 +76,7 @@ typedef enum {
QCLOUD_ERR_JSON_BUFFER_TOO_SMALL = -134, // JSON parsing buffer not enough
QCLOUD_ERR_JSON = -135, // JSON generation error
QCLOUD_ERR_MAX_JSON_TOKEN = -136, // JSON token out of range

QCLOUD_ERR_MAX_APPENDING_REQUEST = -137, // appending request out of range
QCLOUD_ERR_MAX_TOPIC_LENGTH = -138, // Topic length oversize

Expand All @@ -85,7 +85,7 @@ typedef enum {
QCLOUD_ERR_COAP_INTERNAL = -152, // COAP interval error
QCLOUD_ERR_COAP_BADMSG = -153, // COAP bad msg
QCLOUD_ERR_DTLS_PEER_CLOSE_NOTIFY = -160, // DTLS connection is closed

QCLOUD_ERR_SHADOW_PROPERTY_EXIST = -201, // Shadow property already exist
QCLOUD_ERR_SHADOW_NOT_PROPERTY_EXIST = -202, // Shadow property not exist
QCLOUD_ERR_SHADOW_UPDATE_TIMEOUT = -203, // Shadow update timeout
Expand All @@ -101,7 +101,7 @@ typedef enum {

QCLOUD_ERR_TCP_SOCKET_FAILED = -601, // TLS TCP socket connect fail
QCLOUD_ERR_TCP_UNKNOWN_HOST = -602, // TCP unknown host (DNS fail)
QCLOUD_ERR_TCP_CONNECT = -603, // TCP/UDP socket connect fail
QCLOUD_ERR_TCP_CONNECT = -603, // TCP/UDP socket connect fail
QCLOUD_ERR_TCP_READ_TIMEOUT = -604, // TCP read timeout
QCLOUD_ERR_TCP_WRITE_TIMEOUT = -605, // TCP write timeout
QCLOUD_ERR_TCP_READ_FAIL = -606, // TCP read error
Expand Down
26 changes: 13 additions & 13 deletions include/exports/qcloud_iot_export_gateway.h
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ extern "C" {
/* Gateway and sub-device parameter */
typedef struct {
/*gateway device info */
char *product_id;
char *device_name;
/*sub-device device info */
char *subdev_product_id;
char *subdev_device_name;
char *product_id;
char *device_name;
/*sub-device device info */
char *subdev_product_id;
char *subdev_device_name;

} GatewayParam;

Expand All @@ -50,9 +50,9 @@ typedef void (*GatewayEventHandleFun)(void *client, void *context, void *msg);

/* The structure of gateway init param */
typedef struct {
MQTTInitParams init_param; /* MQTT params */
void *event_context; /* the user context */
GatewayEventHandleFun event_handler; /* event handler for gateway user*/
MQTTInitParams init_param; /* MQTT params */
void *event_context; /* the user context */
GatewayEventHandleFun event_handler; /* event handler for gateway user*/
} GatewayInitParam;

#define DEFAULT_GATEWAY_INIT_PARAMS { DEFAULT_MQTTINIT_PARAMS, NULL, NULL}
Expand Down Expand Up @@ -87,7 +87,7 @@ int IOT_Gateway_Destroy(void *client);
int IOT_Gateway_Subdev_Online(void *client, GatewayParam* param);

/**
* @brief Make sub-device offline
* @brief Make sub-device offline
*
* @param client handle to gateway client
* @param param sub-device parameters
Expand All @@ -100,7 +100,7 @@ int IOT_Gateway_Subdev_Offline(void *client, GatewayParam* param);
/**
* @brief Publish gateway MQTT message
*
* @param client handle to gateway client
* @param client handle to gateway client
* @param topic_name MQTT topic name
* @param params publish parameters
*
Expand All @@ -112,7 +112,7 @@ int IOT_Gateway_Publish(void *client, char *topic_name, PublishParams *params);
/**
* @brief Subscribe gateway MQTT topic
*
* @param client handle to gateway client
* @param client handle to gateway client
* @param topic_filter MQTT topic filter
* @param params subscribe parameters
*
Expand All @@ -124,8 +124,8 @@ int IOT_Gateway_Subscribe(void *client, char *topic_filter, SubscribeParams *par
/**
* @brief unsubscribe gateway MQTT topic
*
* @param client handle to gateway client
* @param topic_filter MQTT topic filter
* @param client handle to gateway client
* @param topic_filter MQTT topic filter
*
* @return packet id (>=0) when success, or err code (<0) for failure
*/
Expand Down
60 changes: 30 additions & 30 deletions include/exports/qcloud_iot_export_log.h
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ typedef bool (*LogMessageHandler)(const char* message);
/**
* @brief user callback for saving/reading logs into/from NVS(files/FLASH) after upload fail/recover
*/
// callback for saving logs into NVS(files/FLASH) after upload fail
// callback for saving logs into NVS(files/FLASH) after upload fail
typedef size_t (*LogSaveFunc)(const char *msg, size_t wLen);
// callback for reading logs from NVS(files/FLASH) when upload ready
typedef size_t (*LogReadFunc)(char *buff, size_t rLen);
Expand All @@ -72,8 +72,8 @@ typedef struct {
/* auth key, use device secret for PSK device and cert file path for cert device */
const char *sign_key;
/* user callback saving/reading logs into/from NVS(files/FLASH) */
LogSaveFunc save_func;
LogReadFunc read_func;
LogSaveFunc save_func;
LogReadFunc read_func;
LogDelFunc del_func;
LogGetSizeFunc get_size_func;
} LogUploadInitParams;
Expand All @@ -82,7 +82,7 @@ typedef struct {
/**
* @brief Set the global log level of print
*
* @param level
* @param level
*/
void IOT_Log_Set_Level(LOG_LEVEL level);

Expand Down Expand Up @@ -129,14 +129,14 @@ int IOT_Log_Init_Uploader(LogUploadInitParams *init_params);
/**
* @brief Stop log upload and release the resource
*
* @return
* @return
*/
void IOT_Log_Fini_Uploader(void);

/**
* @brief Do one log upload
*
* @param force_upload true = upload log at once, false = upload in defined time interval
* @param force_upload true = upload log at once, false = upload in defined time interval
* @return QCLOUD_RET_SUCCESS when success, or error code when fail
*/
int IOT_Log_Upload(bool force_upload);
Expand All @@ -162,34 +162,34 @@ void IOT_Log_Gen(const char *file, const char *func, const int line, const int l

/* Macro for debug mode */
#ifdef IOT_DEBUG
#define IOT_FUNC_ENTRY \
{\
printf("FUNC_ENTRY: %s L#%d \n", __FUNCTION__, __LINE__); \
}
#define IOT_FUNC_EXIT \
{\
printf("FUNC_EXIT: %s L#%d \n", __FUNCTION__, __LINE__); \
return;\
}
#define IOT_FUNC_EXIT_RC(x) \
{\
printf("FUNC_EXIT: %s L#%d Return Code : %ld \n", __FUNCTION__, __LINE__, (long)(x)); \
return x; \
}
#define IOT_FUNC_ENTRY \
{\
printf("FUNC_ENTRY: %s L#%d \n", __FUNCTION__, __LINE__); \
}
#define IOT_FUNC_EXIT \
{\
printf("FUNC_EXIT: %s L#%d \n", __FUNCTION__, __LINE__); \
return;\
}
#define IOT_FUNC_EXIT_RC(x) \
{\
printf("FUNC_EXIT: %s L#%d Return Code : %ld \n", __FUNCTION__, __LINE__, (long)(x)); \
return x; \
}
#else
#define IOT_FUNC_ENTRY
#define IOT_FUNC_EXIT \
{\
return;\
}
#define IOT_FUNC_EXIT_RC(x) \
{\
return x; \
}
#define IOT_FUNC_ENTRY
#define IOT_FUNC_EXIT \
{\
return;\
}
#define IOT_FUNC_EXIT_RC(x) \
{\
return x; \
}
#endif

/* Macro for interval debug */
//#define LOG_UPLOAD_DEBUG
//#define LOG_UPLOAD_DEBUG
#ifdef LOG_UPLOAD_DEBUG
#define UPLOAD_DBG(fmt, ...) HAL_Printf(">>LOG-DBG>>%s(%d): " fmt "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
Expand Down
Loading

AltStyle によって変換されたページ (->オリジナル) /