@@ -32,8 +32,8 @@ void jiotRegister(JHandle handle,void* pContext, JClientMessageCallback *cb,JCli
32
32
#### 参数说明
33
33
* handle : JIOT 客户端的句柄
34
34
* pContext:设备的上下文信息
35
- * handleCb:sdk连接状态回调函数结构体
36
35
* cb: 客户端处理下行报文的回调函数结构体
36
+ * handleCb: 客户端处理接收状态回调函数
37
37
38
38
#### 返回值
39
39
无
@@ -48,10 +48,9 @@ int jiotConn(JHandle handle,const DeviceInfo *pDev);
48
48
* handle : JIOT 客户端的句柄
49
49
* pDev :设备三元组
50
50
51
- #### 返回值
52
- * 0成功,非0失败
53
-
54
-
51
+ #### 返回值
52
+ 成功返回JIOT_SUCCESS,失败返回对应错误码
53
+
55
54
## SDK释放接口
56
55
### jiotDisConn
57
56
断开连接MQTT服务端。
@@ -139,35 +138,10 @@ JiotResult jiotVersionReportReq(JHandle handle, const VersionReportReq * pReq);
139
138
#### 参数说明
140
139
* handle : JIOT 客户端的句柄
141
140
* 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 :属性设置回复结构体指针
154
141
155
142
#### 返回值
156
143
返回值结构体,内容为错误码和seqNO
157
144
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
-
171
145
## SDK接收下行消息回调函数接口
172
146
173
147
### jiotPropertyReportRsp
@@ -253,15 +227,16 @@ typedef int jiotMsgDeliverReq(void* pContext, JHandle handle, MsgDeliverReq *Req
253
227
```
254
228
struct JClientMessageCallback
255
229
{
256
- jiotPropertyReportResp *_cbPropertyReportResp ;
257
- jiotEventReportResp *_cbEventReportResp ;
258
- jiotVersionReportReq *_cbVersionReportReq ;
230
+ jiotPropertyReportRsp *_cbPropertyReportRsp ;
231
+ jiotEventReportRsp *_cbEventReportRsp ;
232
+ jiotVersionReportRsp *_cbVersionReportRsp ;
259
233
jiotPropertySetReq *_cbPropertySetReq;
260
234
jiotMsgDeliverReq *_cbMsgDeliverReq;
261
235
} ;
262
236
263
237
```
264
- ## SDK状态回调函数接口
238
+
239
+ ## SDK事件回调函数接口
265
240
266
241
### jiotConnectedHandle
267
242
客户端mqtt连接成功。
@@ -281,13 +256,26 @@ typedef int jiotConnectedHandle(void* pContext);
281
256
typedef int jiotConnectFailHandle(void* pContext,int errCode);
282
257
```
283
258
#### 参数说明
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
+ #### 返回值
288
275
289
276
### jiotSubscribeFailHandle
290
- 客户端subscirbe失败,ACL不通过。
277
+ 客户端subscirbe失败。
278
+
291
279
#### 接口定义
292
280
```
293
281
typedef int jiotSubscribeFailHandle(void* pContext,char * TopicFilter);
@@ -299,7 +287,8 @@ typedef int jiotSubscribeFailHandle(void* pContext,char * TopicFilter);
299
287
无
300
288
301
289
### jiotPublishFailHandle
302
- 客户端publish失败,ACL不通过
290
+ 客户端publish失败。(需要mqtt-V5.0支持该功能)
291
+
303
292
#### 接口定义
304
293
```
305
294
typedef int jiotPublishFailHandle(void* pContext,long long seqNo);
@@ -323,16 +312,16 @@ typedef int jiotMessageTimeoutHandle(void* pContext,long long seqNo);
323
312
#### 返回值
324
313
无
325
314
326
- ## SDK状态回调函数指针结构体
315
+ ## SDK的事件回调函数指针结构体
327
316
```
328
317
typedef struct JClientHandleCallback
329
318
{
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;
336
325
} JClientHandleCallback;
337
326
```
338
327
## 错误码
0 commit comments