|
@@ -1,14 +1,63 @@
|
|
|
# iot服务接口
|
|
|
|
|
|
-采集相关的接口调用iot-collect服务;
|
|
|
+云端接口调用iot-collect服务;
|
|
|
|
|
|
-控制相关的接口调用iot-control服务;
|
|
|
-
|
|
|
-控制和采集的实时业务(不查询历史数据的,如能耗、分精度)也可以调用iot-project服务;
|
|
|
+控制和采集的实时接口也可以调用iot-project服务;
|
|
|
|
|
|
|
|
|
[TOC]
|
|
|
|
|
|
+# websocket
|
|
|
+
|
|
|
+**链接地址:ws://IP:websocketport/websocket?projectId=10位项目ID&type=iot**
|
|
|
+
|
|
|
+参数说明:
|
|
|
+
|
|
|
+websocket端口是单独的端口,和服务端口不是同一个;
|
|
|
+
|
|
|
+| 字段 | 说明 | |
|
|
|
+| ----------- | ------------------------------------------------------------ | ---- |
|
|
|
+| projectId | 10位项目ID | |
|
|
|
+| type | 订阅的数据类型,数值类型iot数据使用iot,其他的数据类型根据情况添加,还可以有text,pointset,message,多个之间使用逗号隔开; | |
|
|
|
+| getFullData | 是否立即获取一次全量数据,不传默认false | |
|
|
|
+
|
|
|
+例如:ws://127.0.0.1:8858/websocket?projectId=1101070037&type=iot,pointset&getFullData=true
|
|
|
+
|
|
|
+**发送数据订阅:**
|
|
|
+
|
|
|
+```
|
|
|
+{
|
|
|
+ "getFullData": "true",
|
|
|
+ "type": [
|
|
|
+ "iot",
|
|
|
+ "pointset"
|
|
|
+ ],
|
|
|
+ "projectId": "1101070037"
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+**带信息点订阅获取数据**
|
|
|
+
|
|
|
+```
|
|
|
+{
|
|
|
+ "getFullData": "true",
|
|
|
+ "type": [
|
|
|
+ "iot",
|
|
|
+ "pointset"
|
|
|
+ ],
|
|
|
+ "points": [
|
|
|
+ {
|
|
|
+ "meter": "1001",
|
|
|
+ "funcid": "11"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "projectId": "1101070037"
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+# HTTP接口
|
|
|
+
|
|
|
+
|
|
|
## 能耗
|
|
|
|
|
|
|