跳到主要内容

设备管理

Status

设备拓扑更新

Topic: sys/product/{gateway_sn}/status

Direction: up

Method: update_topo

Data:

ColumnNameTypeconstraintDescription
domain网关设备的命名空间string参考:产品支持
type网关设备的产品类型int参考:产品支持
sub_type网关子设备的产品子类型int参考:产品支持
device_secret网关设备的密钥text
noncenoncetext
thing_version网关设备的物模型版本text
sub_devices子设备列表array{"size": 1, "item_type": struct}
»sn子设备序列号(SN)text
»domain子设备的命名空间string参考:产品支持
»type子设备的产品类型int参考:产品支持
»sub_type子设备的产品子类型int参考:产品支持
»index连接网关设备的通道索引string
»device_secret子设备的密钥text
»noncenoncetext
»thing_version子设备的物模型版本text

Example:

// sub_devices online
{
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"method": "update_topo",
"timestamp": 1234567890123,
"data": {
"domain": "3",
"type": 119,
"sub_type": 0,
"device_secret": "secret",
"nonce": "nonce",
"thing_version": "1.1.2",
"sub_devices": [
{
"sn": "drone001",
"domain": "0",
"type": 60,
"sub_type": 0,
"index": "A",
"device_secret": "secret",
"nonce": "nonce",
"thing_version": "1.1.2"
}
]
}
}

// sub_devices offline
{
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"method": "update_topo",
"timestamp": 1234567890123,
"data": {
"domain": "3",
"type": 119,
"sub_type": 0,
"device_secret": "secret",
"nonce": "nonce",
"thing_version": "1.1.2",
"sub_devices": []
}
}

Topic: sys/product/{gateway_sn}/status_reply

Direction: down

Method: update_topo

Data:

ColumnNameTypeconstraintDescription
result返回码int非 0 代表错误

Example:

{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "update_topo"
}