数据格式
通用协议
{
"pKey":"产品key",
"dName":"设备名称",
"transaction":"业务标识",
"timestamp":1534353132000
"payload": {
}
}
参数说明
参数名 | 类型 | 说明 |
---|---|---|
pKey | string | 产品key |
dName | string | 设备名称 |
transaction | string | 业务标识 |
timestamp | long | 时间戳,毫秒级 |
payload | json | 透传消息 |
设备上线
{
"pKey":"产品key",
"dName":"设备名称",
"transaction":"deviceOnline",
"timestamp":1534353132000
}
参数说明
参数名 | 类型 | 说明 |
---|---|---|
pKey | string | 产品key |
dName | string | 设备名称 |
transaction | string | 业务标识 |
timestamp | long | 时间戳,毫秒级 |
设备下线
{
"pKey":"产品key",
"dName":"设备名称",
"transaction":"deviceOffline",
"timestamp":1534353132000
}
参数说明
参数名 | 类型 | 说明 |
---|---|---|
pKey | string | 产品key |
dName | string | 设备名称 |
transaction | string | 业务标识 |
timestamp | long | 时间戳,毫秒级 |
添加新设备
{
"pKey":"产品key",
"dName":"设备名称",
"transaction":"addDevice",
"timestamp":1534353132000
}
参数说明
参数名 | 类型 | 说明 |
---|---|---|
pKey | string | 产品key |
dName | string | 设备名称 |
transaction | string | 业务标识 |
timestamp | long | 时间戳,毫秒级 |
删除设备
{
"pKey":"产品key",
"dName":"设备名称",
"transaction":"deleteDevice",
"timestamp":1534353132000
}
参数说明
参数名 | 类型 | 说明 |
---|---|---|
pKey | string | 产品key |
dName | string | 设备名称 |
transaction | string | 业务标识 |
timestamp | long | 时间戳,毫秒级 |
设备激活
{
"pKey":"产品key",
"dName":"设备名称",
"transaction":"activateDevice",
"timestamp":1534353132000
}
参数说明
参数名 | 类型 | 说明 |
---|---|---|
pKey | string | 产品key |
dName | string | 设备名称 |
transaction | string | 业务标识 |
timestamp | long | 时间戳,毫秒级 |
设备数据变化
{
"pKey":"产品key",
"dName":"设备名称",
"transaction":"deviceDataChanged",
"timestamp":1534353132000,
"payload":{
"mid":"123",
"version":"1.0",
"data":{
"params":{
"prop1":"xxx",
"prop2":"xxx"
}
}
}
}
参数说明
参数名 | 类型 | 说明 |
---|---|---|
pKey | string | 产品key |
dName | string | 设备名称 |
transaction | string | 业务标识 |
timestamp | long | 时间戳,毫秒级 |
payload | object | 数据体 |
mid | string | 消息id |
version | string | 协议版本号 |
data | object | 明细数据 |
params | object | 属性字段对象 |
设备事件
{
"pKey":"产品key",
"dName":"设备名称",
"transaction":"deviceEvent",
"timestamp":1534353132000,
"payload":{
"mid":"123",
"version":"1.0",
"data":{
"event":"事件唯一标识",
"params":{
"prop1":"xxx",
"prop2":"xxx"
}
}
}
}
参数说明
参数名 | 类型 | 说明 |
---|---|---|
pKey | string | 产品key |
dName | string | 设备名称 |
transaction | string | 业务标识 |
timestamp | long | 时间戳,毫秒级 |
payload | object | 数据体 |
mid | string | 消息id |
version | string | 协议版本号 |
data | object | 明细数据 |
event | string | 事件唯一标识 |
params | object | 属性字段对象 |
设备间消息路由
{
"pKey":"产品key",
"dName":"设备名称",
"transaction":"deviceMessageForward",
"timestamp":1534353132000,
"payload":{
"mid":"123",
"version":"1.0",
"data":{
"identifer":"system.msg.transform.notice",
"params":{
"fromPKey":"源产品key",
"fromDName":"源设备名称"
}
}
}
}
参数说明
参数名 | 类型 | 说明 |
---|---|---|
pKey | string | 产品key |
dName | string | 设备名称 |
transaction | string | 业务标识 |
timestamp | long | 时间戳,毫秒级 |
payload | object | 数据体 |
mid | string | 消息id |
version | string | 协议版本号 |
data | object | 明细数据 |
identifer | string | 服务标识 |
params | object | 属性字段对象 |
fromPKey | string | 源产品key |
fromDName | string | 源设备名称 |