设备上报升级状态
功能介绍
设备上报升级状态。
Topic
上行: $oc/devices/{device_id}/sys/events/up
参数说明
| 字段名 | 必选/可选 | 类型 | 参数描述 |
|---|---|---|---|
| object_device_id | 可选 | String | 事件对应的最终目标设备,没有携带则表示目标设备即topic中指定的设备 |
| services | 可选 | List<ServiceEvent> | 事件服务列表 |
ServiceEvent定义表
| 字段名 | 必选/可选 | 类型 | 参数描述 |
|---|---|---|---|
| service_id | 必选 | String | $ota |
| event_type | 必选 | String | upgrade_progress_report |
| event_time | 可选 | String | 事件时间 |
| paras | 必选 | Object | 事件参数JSON对象 |
paras参数列表
| 字段名 | 必选/可选 | 类型 | 参数描述 |
|---|---|---|---|
| result_code | 必选 | Integer | 设备的升级状态,结果码定义如下:
|
| progress | 可选 | Integer | 设备的升级进度,范围:0到100 |
| version | 必选 | String | 设备当前版本号 |
| description | 可选 | String | 升级状态描述信息,可以返回具体升级失败原因。 |
示例
Topic: $oc/devices/{device_id}/sys/events/up
数据格式:
{
"object_device_id": "{object_device_id}",
"services": [{
"service_id": "$ota",
"event_type": "upgrade_progress_report",
"event_time": "20151212T121212Z",
"paras": {
"result_code": 0,
"progress": 80,
"version": "V2.0",
"description": "upgrade processing"
}
}]
}
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.