设备时间同步请求
功能描述
设备向平台发起时间同步请求。
Topic
Topic: $oc/devices/{device_id}/sys/events/up
参数说明
| 字段名 | 必选/可选 | 类型 | 参数描述 |
|---|---|---|---|
| object_device_id | 可选 | String | 事件对应的最终目标设备,没有携带则表示目标设备即topic中指定的设备 |
| services | 可选 | List<ServiceEvent> | 事件服务列表 |
ServiceEvent定义表
| 字段名 | 必选/可选 | 类型 | 参数描述 |
|---|---|---|---|
| service_id | 必选 | String | $time_sync |
| event_type | 必选 | String | time_sync_request |
| event_time | 可选 | String | 事件时间 |
| paras | 必选 | Object | 事件参数JSON对象 |
paras参数列表
| 字段名 | 必选/可选 | 类型 | 参数描述 |
|---|---|---|---|
| device_send_time | 必选 | long | 设备发送时间,设备获取自己的当前时间戳,即从格林威治时间1970年01月01日00时00分00秒起至现在的毫秒数 |
示例
Topic: $oc/devices/{device_id}/sys/events/up
数据格式:
{
"object_device_id": "{object_device_id}",
"services": [{
"service_id": "$time_sync",
"event_type": "time_sync_request",
"event_time": "20151212T121212Z",
"paras": {
"device_send_time": 1582685678789
}
}]
}
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.