使用Z-Stack Home 1.2.2a.44539协议栈时发现,当我的设备反复退网并加网多次后,出现设备无法入网的现象,在准备入网的时候,会收到协调器发送的Remove Device指令,导致设备无法加网,
我在协议栈里作了如下修改:
void ZDSecMgrUpdateDeviceInd( ZDO_UpdateDeviceInd_t* ind ) {ZDSecMgrDevice_t device;device.nwkAddr= ind->devAddr;device.extAddr= ind->devExtAddr;device.parentAddr = ind->srcAddr;device.devStatus = DEV_SEC_INIT_STATUS;device.secure= FALSE;// Trust Center should identify the type of JOIN/REJOIN and// Transport the NWK key accordingly, it will only be transported for://APSME_UD_STANDARD_UNSECURED_JOIN//ORAPSME_UD_STANDARD_TRUST_CENTER_REJOINif ( ind->status != APSME_UD_DEVICE_LEFT ){if ( ind->status == APSME_UD_STANDARD_SECURED_REJOIN ){device.devStatus &= ~DEV_SEC_INIT_STATUS;device.devStatus |= DEV_SEC_AUTH_STATUS;device.secure = TRUE;}ZDSecMgrDeviceJoin( &device );}+else+{+ // remove the TCLK NV entry for a device which has left the network+ APSME_TCLinkKeyInit(TRUE);+}
Viki Shi:
频繁加网又退出,是不是关联表满了?删除关联表试试:blog.csdn.net/…/24701879