1、Touch Link连接问题,详细描述如下:
Initiator:ZED
Target:ZR
在Initiator中只有注释掉下面的bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_STEERING) Touch link才能正常工作
bdb_initialize(); printf("IsOnANetwork: %d\n", bdbAttributes.bdbNodeIsOnANetwork); if(bdbAttributes.bdbNodeIsOnANetwork == FALSE) { //bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_STEERING); }
此时Touch Link连接过程如下图,但是没有发送Simple request。
不注释bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_STEERING)这行代码的话就永远加不进网络,如下图,我在代码中添加了很多打印,
发现Initiator收不到Scan Response,打印信息如下,"bdbTL_HdlIncoming\n"并没有打印出来。
static ZStatus_t bdbTL_HdlIncoming( zclIncoming_t *pInMsg ) { ZStatus_t status = ZSuccess; printf("bdbTL_HdlIncoming\n"); if ( StubAPS_InterPan( pInMsg->msg->srcAddr.panId, pInMsg->msg->srcAddr.endPoint ) ) { return ( bdbTL_HdlInInterPANCommands( pInMsg ) ); } if ( zcl_ClusterCmd( pInMsg->hdr.fc.type ) ) { // Is this a manufacturer specific command? if ( pInMsg->hdr.fc.manuSpecific == 0 ) { status = bdbTL_HdlInSpecificCommands( pInMsg ); } else { // We don't support any manufacturer specific command. status = ZFailure; } } else { // Handle all the normal (Read, Write...) commands -- should never get here status = ZFailure; } return ( status ); }
2、Initiator和Target均已开启NV_INIT和NV_RESTORE=1,Initiator掉电重启后只会Rejoin一次,而且没有成功过;Target掉电重启后清除了NV信息。
如下图
抓包信息如下: