zigbee 关联表AssociatedDevList
来源:互联网 发布:淘宝邮票真假怎么鉴定 编辑:程序博客网 时间:2024/06/06 00:48
5)、关联表的操作
AssociatedDevList 表为与此设备相关联的设备表,并不是 ZigBee
网络中的所有设备
信息表。表中信息的 IEEE 地址是唯一的,每个设备加入它的父节点时会在表中添加一个记
录,但是子节点断电离开网络时不会删除该条记录,如果有多个子节点,频繁更换父节点会
造成 AssociatedDevList 表满或溢出,使其它子节点无法加入该父节点,因此需要及时的删
除一些已离开的子节点记录。
5.1、关联表的定义
在 nwk_globals.C 文件中有对关联表的定义,代码如下:
if defined(RTR_NWK)
// Statically defined Associated Device List
associated_devices_t
AssociatedDevList[NWK_MAX_DEVICES];
endif
5.2、关联表的结构
在 AssocList.h 文件中有对关联表结构 associated_devices_t
的定义,代码如下:
typedef struct
{
UINT16 shortAddr;
关联设备的短地址
uint16 addrIdx;
地址管理时的索引
byte nodeRelation;
关联设备的描述
byte devStatus;
设备的状态值
byte assocCnt;
地址连接时会加 1
linkInfo_t linkInfo;
连接信息
} associated_devices_t;
devStatus 可以设置为以下的值
define DEV_LINK_STATUS 0x01 //
link is in-active ? 活动联接
define DEV_LINK_REPAIR 0x02 //
link repair in progress ?正在修复联接
define DEV_SEC_INIT_STATUS 0x04 // security init
初后的安全
define DEV_SEC_AUTH_STATUS 0x08 // security authenticated
验正过的安全
nodeRelation 可以设置为以下的值
// Node Relations
define PARENT 0//父节点
一般指协调器
define CHILD_RFD 1//简功能节点
一般指终端
define
CHILD_RFD_RX_IDLE
RF 接收开启) 一般指终端
define CHILD_FFD 3//全功能节点
一般指路由器
define
CHILD_FFD_RX_IDLE
RF 接收开启) 一般指路由器
define
NEIGHBOR
define
OTHER
define NOTUSED 0xFF
//没有使用
在 ZComDef.h 文件中有对 linkInfo_t 的定义,代码如下:
typedef struct
{
uint8 txCost;
uint8 rxCost;
// counter of transmission success/failures
// average of received rssi values
uint8 inKeySeqNum; // security key sequence number
uint32 inFrmCntr;
// security frame counter..
} linkInfo_t;
5.3、关联表记录的查看
可以直接从
AssociatedDevList[NWK_MAX_DEVICES]数组中查看关联设备的信息,比如:
for (uint8 x=0;x
{
byte nr = AssociatedDevList[x].nodeRelation;
…
5.4、关联表记录的删除
关联表的删除可以有多种方法,可以用 AssocList.h 文件中的函数,也可以直接在 NV
区中删除,下面只对 AssocList.h 文件中的函数部分举例说明,代码如下:
AddrMgrEntry_t addrEntry;
NLME_LeaveReq_t req;
uint8 i = Z_EXTADDR_LEN + 1;
// Set up device info
addrEntry.user = ADDRMGR_USER_DEFAULT;
addrEntry.index = index;
if (AddrMgrEntryGet( &addrEntry ))
{
for (i = 0; i < Z_EXTADDR_LEN; i++ )
{
if ( addrEntry.extAddr
0 ){ break;}
}
}
if(i < Z_EXTADDR_LEN){
// Remove device
req.extAddr = addrEntry.extAddr;
req.removeChildren = TRUE;
req.rejoin = TRUE;
req.silent = FALSE;
NLME_LeaveReq( &req );
}else{
AssocRemove(addrEntry.extAddr);
ZDApp_NVUpdate();
}
- zigbee关联表AssociatedDevList
- zigbee关联表AssociatedDevList
- zigbee 关联表AssociatedDevList
- Zigbee关联表AssociatedDevList的操作
- Zigbee关联表AssociatedDevList的操作
- 关联AssociatedDevList表的操作
- ZIgbee设备加入网络过程(方式一 关联加入)
- ZIgbee设备加入网络过程(方式一 关联加入)
- Zigbee设备入网流程分析(关联方式)
- zigbee 绑定表
- ZigBee
- Zigbee
- Zigbee
- ZigBee
- ZigBee
- ZigBee
- zigbee
- zigbee
- 【effective Java读书笔记】对于所有对象都通用的方法(二)
- H5项目常见问题及注意事项
- 滑动解锁效果
- HDU 3294Girls' research
- Open-falcon Agent模块rpc通信过程
- zigbee 关联表AssociatedDevList
- 从零开始搭建环境编写操作系统 AT&T GCC (十)多任务
- 10、maven学习总结
- leetcode--Number of Islands
- 16、购物单
- TFTP相关指令内容
- 学习问题
- HDU 4513吉哥系列故事——完美队形II
- linux命令sed