代码拉取完成,页面将自动刷新
$ curl http://localhost:59881/api/v2/device -H "Content-Type:application/json" -X POST \
-d '[
{
"apiVersion": "v2",
"device": {
"name" :"Modbus-TCP-Temperature-Sensor",
"description":"This device is a product for monitoring the temperature via the ethernet",
"labels":[
"Temperature",
"Modbus TCP"
],
"serviceName": "device-modbus",
"profileName": "Ethernet-Temperature-Sensor",
"protocols":{
"modbus-tcp":{
"Address" : "172.17.0.1",
"Port" : "502",
"UnitID" : "1",
"Timeout" : "5",
"IdleTimeout" : "5"
}
},
"autoEvents":[
{
"Interval":"30s",
"onChange":false,
"SourceName":"Temperature"
}
],
"adminState":"UNLOCKED",
"operatingState":"UP"
}
}
]'
$ curl http://192.168.3.45:59882/api/v2/device/name/Modbus-TCP-Temperature-Sensor/AlarmThreshold \
-H "Content-Type:application/json" -X PUT \
-d '{"ThermostatL":"15","ThermostatH":"100"}'
$ curl http://localhost:59882/api/v2/device/name/Modbus-TCP-Temperature-Sensor/AlarmThreshold | json_pp
{
"statusCode" : 200,
"apiVersion" : "v2",
"event" : {
"origin" : 1624324686964377495,
"deviceName" : "Modbus-TCP-Temperature-Sensor",
"id" : "f3d44a0f-d2c3-4ef6-9441-ad6b1bfb8a9e",
"sourceName" : "AlarmThreshold",
"readings" : [
{
"resourceName" : "ThermostatL",
"value" : "1.500000e+01",
"deviceName" : "Modbus-TCP-Temperature-Sensor",
"id" : "9aa879a0-c184-476b-8124-34d35a2a51f3",
"valueType" : "Float32",
"mediaType" : "",
"binaryValue" : null,
"origin" : 1624324686963970614,
"profileName" : "Ethernet-Temperature-Sensor"
},
{
"value" : "1.000000e+02",
"resourceName" : "ThermostatH",
"deviceName" : "Modbus-TCP-Temperature-Sensor",
"id" : "bf7df23b-4338-4b93-a8bd-7abd5e848379",
"valueType" : "Float32",
"mediaType" : "",
"binaryValue" : null,
"origin" : 1624324686964343768,
"profileName" : "Ethernet-Temperature-Sensor"
}
],
"apiVersion" : "v2",
"profileName" : "Ethernet-Temperature-Sensor"
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。