Hi,
I've read posts on the subject, but didn't see any answer, so...
I have:
1) CC2530ZDK
2) Z-stack:
a) CC2530-2.5.1a;
b) Energy 1.1.0;
c) Lighting 1.0.1.
The distance between the routers 10cm.
The distance between the routers and the coordinator of 40cm.
1) Start Network:
ZC-|
|
|-ZR1-|
|
|-ZR2
2) After Reset ZR1:
ZC-|
|-ZR1-|
| |
|-ZR2-|
etc.
ZR1->_NIB.nwkCoordAddress == ZR2-> _NIB. nwkDevAddress
and
ZR2->_NIB.nwkCoordAddress == ZR1 -> _NIB. nwkDevAddress
I change function ZMacAssociateRsp in module zmac.c:
uint8 ZMacAssociateRsp( ZMacAssociateRsp_t *pData )
{
//=========================================================================
zAddrType_t AT;
unDataBuf.TestOut.ui8Val1 = 0;
unDataBuf.TestOut.ui8Val2 = 0;
unDataBuf.TestOut.ui16Val1 = pData->AssocShortAddress;
unDataBuf.TestOut.ui16Val2 = 0;
osal_memcpy( unDataBuf.TestOut.dui8Data, pData->DeviceAddress, Z_EXTADDR_LEN );
if( pData->AssocShortAddress == _NIB.nwkCoordAddress )
{
unDataBuf.TestOut.ui8Val1 = 1;
}
else if( osal_memcmp( pData->DeviceAddress, _NIB.nwkCoordExtAddress, Z_EXTADDR_LEN ) == TRUE )
{
unDataBuf.TestOut.ui8Val1 = 2;
}
else if( AssocIsParent( pData->AssocShortAddress ) )
{
unDataBuf.TestOut.ui8Val1 = 3;
}
else
{
AT.addr.shortAddr = pData->AssocShortAddress;
AT.addrMode = Addr16Bit;
if( MAC_SrcMatchAddEntry( (sAddr_t*)&AT, _NIB.nwkPanId ) )
{
unDataBuf.TestOut.ui8Val1 = 4;
}
}
//=========================================================================
if( unDataBuf.TestOut.ui8Val1 != 0 )
{
zb_SendDataRequest( 0x0000, Z2A_ZDO_TEST_RSP, sizeof(z_d_TestOut_t), (uint8*)&unDataBuf, ui8Handle++, AF_TX_OPTIONS_NONE, 0 );
return MAC_NO_RESOURCES;
}
//=========================================================================
/* TBD: set security to zero for now. Require Ztool change */
pData->Sec.SecurityLevel = false;
return ( MAC_MlmeAssociateRsp( (macMlmeAssociateRsp_t *) pData ) );
}
After change take place if( osal_memcmp( pData->DeviceAddress, _NIB.nwkCoordExtAddress, Z_EXTADDR_LEN ) == TRUE )
in function ZMacAssociateRsp every 8 seconds.
It does not depend on the version of Z-stack.
I repeated this situation by using a program SensorDemo.
This error Z-Stack does not allow to build the system that uses a lot of routers
and where you need to know the address of a parent.
Also, the Z-Stack blocks the attempt to correct the error of the function ZMacAssociateRsp.
What am I doing wrong?
Thanks, Michael.