感谢回复,这个帖子过的时间有点久了,我现在有时间重新看这部分的内容之后,上面的json内容可能会有误解。我重新贴一下:
{
"$schema":"file:\/\/\/BlueZ\/Mesh\/local_schema\/mesh.jsonschema",
"meshName":"BT Mesh",
"netKeys":[
{
"index":0,
"keyRefresh":0
}
],
"appKeys":[
{
"index":0,
"boundNetKey":0
},
{
"index":1,
"boundNetKey":0
}
],
"node":{
"composition":{
"cid":"0002",
"pid":"0010",
"vid":"0001",
"crpl":"000a",
"features":{
"relay":false,
"proxy":true,
"friend":false,
"lowPower":false
},
"elements":[
{
"elementIndex":0,
"location":"0001",
"models":[
"0000",
"0001",
"1001"
]
}
]
},
"configuration":{
"netKeys":[
0
],
"appKeys":[
0,
1
],
"defaultTTL":10,
"elements":[
{
"elementIndex":0,
"unicastAddress":"0077",
"models":[
{
"modelId":"1001",
"bind":[
1
]
}
]
}
]
},
"IVindex":5,
"IVupdate":0,
"sequenceNumber":807
}
}
上面这一块是我上个回复的json内容(排版容易看点)。这个我看了一下确实是provisioner(树莓派(bluez))的数据。另外我用它作为provisioner添加了两个节点,node_1和node_2,它们的内容是下面的json:
{
"$schema":"file:\/\/\/BlueZ\/Mesh\/schema\/mesh.jsonschema",
"meshName":"BT Mesh",
"netKeys":[
{
"index":0,
"keyRefresh":0,
"key":"18eed9c2a56add85049ffc3c59ad0e12"
}
],
"appKeys":[
{
"index":0,
"boundNetKey":0,
"key":"4f68ad85d9f48ac8589df665b6b49b8a"
},
{
"index":1,
"boundNetKey":0,
"key":"2aa2a6ded5a0798ceab5787ca3ae39fc"
}
],
"provisioners":[
{
"provisionerName":"BT Mesh Provisioner",
"unicastAddress":"0077",
"allocatedUnicastRange":[
{
"lowAddress":"0100",
"highAddress":"7fff"
}
]
}
],
"nodes":[
{
"deviceKey":"74e7f645e438863d95a6d8e05df5e9ea",
"configuration":{
"netKeys":[
"0000"
],
"elements":[
{
"elementIndex":0,
"unicastAddress":"0100",
"models":[
{
"modelId":"1000",
"bind":[
1
],
"subscribe":[
"c000"
]
}
]
}
],
"appKeys":[
"0001"
]
},
"composition":{
"cid":"08b4",
"pid":"0006",
"vid":"000f",
"crpl":"0020",
"features":{
"relay":true,
"proxy":true,
"friend":false,
"lpn":false
},
"elements":[
{
"elementIndex":0,
"location":"0000",
"models":[
"0000",
"0002",
"1000",
"1300",
"1301",
"1303",
"1304",
"1306",
"1307",
"01710004"
]
}
]
},
"IVindex":5,
"sequenceNumber":13
},
{
"deviceKey":"440ea50edf6f5bb2bc08ef87e97983ea",
"configuration":{
"netKeys":[
"0000"
],
"elements":[
{
"elementIndex":0,
"unicastAddress":"0101",
"models":[
{
"modelId":"1000",
"bind":[
1
],
"subscribe":[
"c000"
],
"publish":{
"address":"c000",
"index":"0001",
"ttl":255
}
}
]
}
],
"appKeys":[
"0001"
]
},
"composition":{
"cid":"08b4",
"pid":"0006",
"vid":"000f",
"crpl":"0020",
"features":{
"relay":true,
"proxy":true,
"friend":false,
"lpn":false
},
"elements":[
{
"elementIndex":0,
"location":"0000",
"models":[
"0000",
"0002",
"1000",
"1300",
"1301",
"1303",
"1304",
"1306",
"1307",
"01710004"
]
}
]
},
"IVindex":5,
"sequenceNumber":21
}
],
"IVindex":5,
"IVupdate":0
}
- 从上面结果看下来的话provisioner确实既有configuration client也有configuration server了。
- 我还想额外提一个问题,假设这里有两个灯设备,我的网关作为配置者(provisioner)也能够控制这两个灯。在不使用组播的前提下,我用单播控制两个灯,那在网关这边只需要在主元素里定义一个generic on-off client就够了吧?有没有必要在主元素定义一个generic on-off client控制灯A,在次元素A定义一个generic on-off client控制灯B?提这个问题的目的主要是想是否可以在client端这边只用主元素,不额外用次元素定义这么多client,毕竟控制端不会保存状态。