设备成员变更
绑定终端设备关系变化。
Topic
$hw/events/node/{node_id}/membership/updated
|
参数 |
类型 |
说明 |
|---|---|---|
|
node_id |
String |
节点ID |
使用方式
使用MQTT客户端订阅该Topic。
参数说明
|
参数 |
类型 |
说明 |
|---|---|---|
|
event_id |
String |
事件ID |
|
timestamp |
Int64 |
事件发生事件戳 |
|
added_devices |
Array |
终端设备信息集合,每个终端设备包含设备的id、name、attributes、twin等信息。 |
|
removed_devices |
Array |
终端设备信息集合,每个终端设备包含设备的id、name、attributes、twin等信息。 |
示例
终端设备绑定到边缘节点时可收到如下消息。
$hw/events/node/{node_id}/membership/updated
{
"event_id":"04a975ab-fd51-49be-85f5-5967e994f640",
"timestamp":1557314742136,
"added_devices":[
{
"id":"ab39361a-6fc0-4c94-b919-72b1e08ca690",
"name":"IEF-device",
"state":"unknown",
"attributes":{
"address":{
"value":"shenzhen",
"optional":true,
"metadata":{
"type":"string"
}
}
},
"twin":{
"state":{
"expected":{
"value":"running",
"metadata":{
"timestamp":1557314434570
}
},
"optional":true,
"metadata":{
"type":"string"
}
}
}
}
],
"removed_devices":null
}