[转载]ZIGBEE:Coordinator中的邻居表(Neighbour Table)问题
生活随笔
收集整理的這篇文章主要介紹了
[转载]ZIGBEE:Coordinator中的邻居表(Neighbour Table)问题
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
主節(jié)點的鄰居表的大小為24,意味著主節(jié)點最多只可以有24個子節(jié)點(enddevice或router)。 在主節(jié)點中的JZA_vStackEvent事件中,在網(wǎng)絡(luò)成功啟動時可以設(shè)置這樣一個參數(shù): JZS_vEnableEDAddrReuse(1800); 括號里德參數(shù)單位是s,表示的是,如果1800s內(nèi)子節(jié)點還沒有跟主節(jié)點進行數(shù)據(jù)通訊,則主節(jié)點會認為子節(jié)點死掉,接著就會觸發(fā)JZS_EVENT_INACTIVE_ED_DELETED事件,將子節(jié)點從自己的鄰居表刪除,因此,當子節(jié)點成功入網(wǎng)后,如果設(shè)置了JZS_vEnableEDAddrReuse(1800),底層代碼中最好在要最多每隔1800s就要跟主節(jié)點進行數(shù)據(jù)通訊,否則,主節(jié)點會將該節(jié)點的網(wǎng)絡(luò)信息從鄰居表中刪除,這樣,主節(jié)點發(fā)送出的數(shù)據(jù),子節(jié)點就收不到了。 但是在這種情況下,如果,子節(jié)點默認的發(fā)送目標地址是其父節(jié)點,發(fā)送出來的數(shù)據(jù),父節(jié)點還是能收到了。這樣,子節(jié)點能找到父節(jié)點,但是父節(jié)點找不到子節(jié)點,唯一的方法是將子節(jié)點的網(wǎng)絡(luò)信息擦除再重新入網(wǎng)。 下面的代碼描述的是如何讀鄰居表: PUBLIC void vReadNeighbourTable(uint8 notify_flag)
{
??? int i;
??? vPrintf("\n-- network table --\n");
??? //Neighbor table
??? for (i = 0; i < gsNIB.nwkNeighborTableSize; i++)
??? {
??????? if(gsNIB.nwkNeighborTable[i].u16Addr==0xffff)
??????????? continue;
??????? vPrintf("Neighbor %d: addr = %d, mac:%x-%x, Device Type=%d, LQI = %d, Channel = %d\n",
??????????? i,
??????????? gsNIB.nwkNeighborTable[i].u16Addr,
??????????? gsNIB.nwkNeighborTable[i].sExtAddr.u32H,
??????????? gsNIB.nwkNeighborTable[i].sExtAddr.u32L,
??????????? gsNIB.nwkNeighborTable[i].eDevicetype,
??????????? gsNIB.nwkNeighborTable[i].u8LQI,
??????????? gsNIB.nwkNeighborTable[i].u8Channel
??????????? );
??????? if(notify_flag){}
??? }
轉(zhuǎn)自;http://lihf198628.blog.163.com/blog/static/113814520108693939683/
{
??? int i;
??? vPrintf("\n-- network table --\n");
??? //Neighbor table
??? for (i = 0; i < gsNIB.nwkNeighborTableSize; i++)
??? {
??????? if(gsNIB.nwkNeighborTable[i].u16Addr==0xffff)
??????????? continue;
??????? vPrintf("Neighbor %d: addr = %d, mac:%x-%x, Device Type=%d, LQI = %d, Channel = %d\n",
??????????? i,
??????????? gsNIB.nwkNeighborTable[i].u16Addr,
??????????? gsNIB.nwkNeighborTable[i].sExtAddr.u32H,
??????????? gsNIB.nwkNeighborTable[i].sExtAddr.u32L,
??????????? gsNIB.nwkNeighborTable[i].eDevicetype,
??????????? gsNIB.nwkNeighborTable[i].u8LQI,
??????????? gsNIB.nwkNeighborTable[i].u8Channel
??????????? );
??????? if(notify_flag){}
??? }
轉(zhuǎn)自;http://lihf198628.blog.163.com/blog/static/113814520108693939683/
轉(zhuǎn)載于:https://www.cnblogs.com/qmlm8844/archive/2012/03/05/2379935.html
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎總結(jié)
以上是生活随笔為你收集整理的[转载]ZIGBEE:Coordinator中的邻居表(Neighbour Table)问题的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 32位微处理器的虚拟技术,是“坑爹”么!
- 下一篇: SqlDataAdapter和SqlCo