加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
test-mqtt-profile.yaml 3.54 KB
一键复制 编辑 原始数据 按行查看 历史
Huaqiao Zhang 提交于 2019-04-14 01:38 . 对应的device profile文件
name: "test-mqtt-profile"
manufacturer: "VMware huaqiaoz"
model: "MQTT-2"
labels:
- "test"
description: "Test device profile"
deviceResources:
-
name: collect
description: "collect data actively"
attributes:
{ name: "collect" }
properties:
value:
{ type: "Boolean", size: "1", readWrite: "RW", defaultValue: "false" }
units:
{ type: "String", readWrite: "RW", defaultValue: "OFF" }
-
name: randnum
description: "device random number"
attributes:
{ name: "randnum" }
properties:
value:
{ type: "Float", size: "4", readWrite: "R", defaultValue: "0.00", minimum: "100.00", maximum: "0.00" }
units:
{ type: "String", readWrite: "R", defaultValue: "" }
-
name: ping
description: "device awake"
attributes:
{ name: "ping" }
properties:
value:
{ type: "String", size: "0", readWrite: "R", defaultValue: "oops" }
units:
{ type: "String", readWrite: "R", defaultValue: "" }
-
name: message
description: "device notification message"
attributes:
{ name: "message" }
properties:
value:
{ type: "String", size: "0", readWrite: "W" ,scale: "", offset: "", base: "" }
units:
{ type: "String", readWrite: "R", defaultValue: "" }
resources:
-
name: testcollect
get:
- { index: "1", operation: "get", object: "collect", property: "value" }
set:
- { index: "1", operation: "set", object: "collect", parameter: "enableCollect", property: "value" }
-
name: testrandnum
get:
- { index: "1", operation: "get", object: "randnum", parameter: "randnum", property: "value" }
-
name: testping
get:
- { index: "1", operation: "get", object: "ping", parameter: "ping", property: "value" }
-
name: testmessage
get:
- { index: "1", operation: "get", object: "message", property: "value" }
set:
- { index: "1", operation: "set", object: "message", parameter: "message", property: "value" }
commands:
-
name: testcollect
get:
path: "/api/v1/device/{deviceId}/testcollect"
responses:
-
code: "200"
description: "get the collect status"
expectedValues: ["collect"]
-
code: "503"
description: "service unavailable"
expectedValues: []
put:
path: "/api/v1/device/{deviceId}/testcollect"
parameterNames: ["enableCollect"]
responses:
-
code: "204"
description: "set the message."
expectedValues: []
-
code: "503"
description: "service unavailable"
expectedValues: []
-
name: testrandnum
get:
path: "/api/v1/device/{deviceId}/testrandnum"
responses:
-
code: "200"
description: "get the random value"
expectedValues: ["randnum"]
-
code: "503"
description: "service unavailable"
expectedValues: []
-
name: testping
get:
path: "/api/v1/device/{deviceId}/testping"
responses:
-
code: "200"
description: "ping the device"
expectedValues: ["ping"]
-
code: "503"
description: "service unavailable"
expectedValues: []
-
name: testmessage
get:
path: "/api/v1/device/{deviceId}/testmessage"
responses:
-
code: "200"
description: "get the message"
expectedValues: ["message"]
-
code: "503"
description: "service unavailable"
expectedValues: []
put:
path: "/api/v1/device/{deviceId}/testmessage"
parameterNames: ["message"]
responses:
-
code: "204"
description: "set the message."
expectedValues: []
-
code: "503"
description: "service unavailable"
expectedValues: []
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化