网关更新子设备状态
功能介绍
网关更新子设备状态。
Topic
上行: $oc/devices/{device_id}/sys/events/up
参数说明
| 字段名 | 必选/可选 | 类型 | 参数描述 |
|---|---|---|---|
| object_device_id | 可选 | String | 事件对应的最终目标设备,没有携带则表示目标设备即topic中指定的设备 |
| services | 可选 | List<EventService> | 事件服务列表 |
EventService定义表
| 字段名 | 必选/可选 | 类型 | 参数描述 |
|---|---|---|---|
| service_id | 必选 | String | $sub_device_manager |
| event_type | 必选 | String | sub_device_update_status |
| event_time | 可选 | String | 事件时间 |
| paras | 必选 | Object | 事件参数JSON对象 |
paras参数列表
| 字段名 | 必选/可选 | 类型 | 参数描述 |
|---|---|---|---|
| device_statuses | 必选 | List<DeviceStatus> | 设备状态列表,列表大小1~100 |
DeviceStatus定义表:
| 字段名 | 必选/可选 | 类型 | 参数描述 |
|---|---|---|---|
| device_id | 必选 | String | 子设备ID |
| status | 必选 | String | 子设备状态。
|
示例
Topic: $oc/devices/{device_id}/sys/events/up
数据格式: {
"services": [{
"service_id": "$sub_device_manager",
"event_type": "sub_device_update_status",
"event_time": "20151212T121212Z",
"paras": {
"device_statuses": [{
"device_id": "bf40f0c4-4022-41c6-a201-c5133122054a",
"status": "ONLINE"
},
{
"device_id": "4459c0f7-10bb-4718-9b07-7a82c2d508a5",
"status": "ONLINE"
}
]
}
}]
}
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.