Skip to content
This repository was archived by the owner on Aug 14, 2019. It is now read-only.

Commit 252b14e

Browse files
authored
Merge pull request #1088 from try2giveup/master
C SDK 1.0.5 release
2 parents 48060b8 + ce28e77 commit 252b14e

File tree

2 files changed

+51
-47
lines changed

2 files changed

+51
-47
lines changed

zh/jiot/client/c_sdk_api.md

Lines changed: 36 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ void jiotRegister(JHandle handle,void* pContext, JClientMessageCallback *cb,JCli
3232
#### 参数说明
3333
* handle :JIOT客户端的句柄
3434
* pContext:设备的上下文信息
35-
* handleCb:sdk连接状态回调函数结构体
3635
* cb: 客户端处理下行报文的回调函数结构体
36+
* handleCb: 客户端处理接收状态回调函数
3737

3838
#### 返回值
3939
@@ -48,10 +48,9 @@ int jiotConn(JHandle handle,const DeviceInfo *pDev);
4848
* handle :JIOT客户端的句柄
4949
* pDev :设备三元组
5050

51-
#### 返回值
52-
* 0成功,非0失败
53-
54-
51+
#### 返回值
52+
成功返回JIOT_SUCCESS,失败返回对应错误码
53+
5554
## SDK释放接口
5655
### jiotDisConn
5756
断开连接MQTT服务端。
@@ -139,35 +138,10 @@ JiotResult jiotVersionReportReq(JHandle handle, const VersionReportReq * pReq);
139138
#### 参数说明
140139
* handle :JIOT客户端的句柄
141140
* pReq :上报消息的结构体指针
142-
#### 返回值
143-
返回值结构体,内容为错误码和seqNO
144-
145-
### jiotPropertySetRsp
146-
JIOT客户端回复属性设置请求的回复
147-
#### 接口定义
148-
```
149-
JiotResult jiotPropertySetRsp(JHandle handle, const PropertySetRsp * Rsp);
150-
```
151-
#### 参数说明
152-
* handle :JIOT客户端的句柄
153-
* Rsp :属性设置回复结构体指针
154141

155142
#### 返回值
156143
返回值结构体,内容为错误码和seqNO
157144

158-
### jiotMsgDeliverRsp
159-
JIOT客户端回复消息下发请求的回复
160-
161-
#### 接口定义
162-
```
163-
JiotResult jiotMsgDeliverRsp(JHandle handle,const MsgDeliverRsp * Rsp);
164-
```
165-
#### 参数说明
166-
* handle :JIOT客户端的句柄
167-
* Rsp :属性设置回复结构体指针
168-
#### 返回值
169-
返回值结构体,内容为错误码和seqNO
170-
171145
## SDK接收下行消息回调函数接口
172146

173147
### jiotPropertyReportRsp
@@ -253,15 +227,16 @@ typedef int jiotMsgDeliverReq(void* pContext, JHandle handle, MsgDeliverReq *Req
253227
```
254228
struct JClientMessageCallback
255229
{
256-
jiotPropertyReportResp *_cbPropertyReportResp;
257-
jiotEventReportResp *_cbEventReportResp;
258-
jiotVersionReportReq *_cbVersionReportReq;
230+
jiotPropertyReportRsp *_cbPropertyReportRsp;
231+
jiotEventReportRsp *_cbEventReportRsp;
232+
jiotVersionReportRsp *_cbVersionReportRsp;
259233
jiotPropertySetReq *_cbPropertySetReq;
260234
jiotMsgDeliverReq *_cbMsgDeliverReq;
261235
} ;
262236
263237
```
264-
## SDK状态回调函数接口
238+
239+
## SDK事件回调函数接口
265240

266241
### jiotConnectedHandle
267242
客户端mqtt连接成功。
@@ -281,13 +256,26 @@ typedef int jiotConnectedHandle(void* pContext);
281256
typedef int jiotConnectFailHandle(void* pContext,int errCode);
282257
```
283258
#### 参数说明
284-
* pContext:用户注册的上下文信息
285-
* errCode JIOT客户端异常错误码
286-
#### 返回值
287-
259+
* pContext:用户注册的上下文信息
260+
* errCode JIOT客户端异常错误码
261+
262+
#### 返回值
263+
264+
### jiotDisconnectHandle
265+
客户端mqtt连接断开。
266+
267+
#### 接口定义
268+
```
269+
typedef int jiotDisconnectHandle(void* pContext);
270+
```
271+
#### 参数说明
272+
* pContext:用户注册的上下文信息
273+
274+
#### 返回值
288275

289276
### jiotSubscribeFailHandle
290-
客户端subscirbe失败,ACL不通过。
277+
客户端subscirbe失败。
278+
291279
#### 接口定义
292280
```
293281
typedef int jiotSubscribeFailHandle(void* pContext,char * TopicFilter);
@@ -299,7 +287,8 @@ typedef int jiotSubscribeFailHandle(void* pContext,char * TopicFilter);
299287
300288

301289
### jiotPublishFailHandle
302-
客户端publish失败,ACL不通过
290+
客户端publish失败。(需要mqtt-V5.0支持该功能)
291+
303292
#### 接口定义
304293
```
305294
typedef int jiotPublishFailHandle(void* pContext,long long seqNo);
@@ -323,16 +312,16 @@ typedef int jiotMessageTimeoutHandle(void* pContext,long long seqNo);
323312
#### 返回值
324313
325314

326-
## SDK状态回调函数指针结构体
315+
## SDK的事件回调函数指针结构体
327316
```
328317
typedef struct JClientHandleCallback
329318
{
330-
jiotConnectedHandle *_cbConnectedHandle; //mqtt连接成功
331-
jiotConnectFailHandle *_cbConnectFailHandle; //mqtt连接失败
332-
jiotDisconnectHandle *_cbDisconnectHandle; //mqtt连接中断
333-
jiotSubscribeFailHandle *_cbSubscribeFailHandle; //消息subscirbe失败,ACL不通过
334-
jiotPublishFailHandle *_cbPublishFailHandle; //消息publish失败,ACL不通过。由于MQTT3.1.1版本不支持,所以SDK暂时不支持,后续再开放
335-
jiotMessageTimeoutHandle *_cbMessageTimeoutHandle; //消息发送超时
319+
jiotConnectedHandle *_cbConnectedHandle;
320+
jiotConnectFailHandle *_cbConnectFailHandle;
321+
jiotDisconnectHandle *_cbDisconnectHandle;
322+
jiotSubscribeFailHandle *_cbSubscribeFailHandle;
323+
jiotPublishFailHandle *_cbPublishFailHandle;
324+
jiotMessageTimeoutHandle *_cbMessageTimeoutHandle;
336325
} JClientHandleCallback;
337326
```
338327
## 错误码

zh/jiot/updates.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
# 最近更新
2+
### JIoT C SDK 1.0.5
3+
#### 更新时间
4+
+ 2019-08-06
5+
6+
#### 适用平台
7+
ARMv7, x86, ESP8266,M5311
8+
#### Change Log
9+
+ 新增SDK事件回调接口
10+
+ 移除jiotPropertySetRsp和jiotMsgDeliverRsp接口,sdk收到消息时直接回复rsp,不需要主动回复
11+
+ 新增针对中移物联网的M5311 NB-IoT模组的支持
12+
13+
#### 升级提示
14+
+ 首先解压您获取到的压缩包
15+
+ 更新库文件
16+
217
### JIoT Android SDK 1.0.2
318
#### 更新时间
419
+ 2019-07-03

0 commit comments

Comments
 (0)