设备时间同步请求
功能描述
设备向平台发起时间同步请求。
Topic
上行: $oc/devices/{device_id}/sys/events/up
参数说明
|
字段名 |
必选/可选 |
类型 |
参数描述 |
|---|---|---|---|
|
object_device_id |
可选 |
String |
参数解释:
|
|
services |
可选 |
List<ServiceEvent> |
参数解释: 事件服务列表。 |
ServiceEvent定义表
|
字段名 |
必选/可选 |
类型 |
参数描述 |
|---|---|---|---|
|
service_id |
必选 |
String |
参数解释: 系统字段。 取值范围: 固定为:"$time_sync"。 |
|
event_type |
必选 |
String |
参数解释: 系统字段。 取值范围: 固定为:"time_sync_request"。 |
|
event_time |
可选 |
String |
参数解释: 事件时间。UTC时间,格式:yyyyMMdd'T'HHmmss'Z'。 设备上报数据不带该参数或参数格式错误时,则数据上报时间以平台时间为准。 |
|
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
}
}]
}