TI中文支持网
TI专业的中文技术问题搜集分享网站

关于zstack 3.0.2的bug修改说明

根据下面链接来修改的,协调器2538,终端2530,都是基于3.0.2协议栈(HomeAutomation)

1.关于第24条的修改:

修改为   i = (gMAX_NWK_SEC_MATERIAL_TABLE_ENTRIES – 1); // ADD THIS LINE

请问这里的修改是不是协调器和终端里面都需要修改?

2.关于第18条的修改:

In ZDApp_ProcessNetworkJoin of ZDApp.c, remove NLME_SetPollRate( zgRejoinPollRate ); from if
(nwkStatus == ZSuccess) and place in the else statement instead. One must also set the
zgRejoinPollRate when device state is DEV_END_DEVICE_UNAUTH

2.1:这句话具体怎么修改?NLME_SetPollRate( zgRejoinPollRate )放在else的什么位置?

2.2:One must also set the
zgRejoinPollRate when device state is DEV_END_DEVICE_UNAUTH

这个具体怎么设置呢?

Optimally, also place NLME_SetPollRate( ZDApp_SavedPollRate ); inside of ZDO_JoinConfirmCB

2.3:这句话具体怎么修改?NLME_SetPollRate( ZDApp_SavedPollRate );放在ZDO_JoinConfirmCB的哪个位置?

2.4:关于第18条的修改是协调器和终端都需要修改吗?

Kevin Qiu1:

只改一处就可以了,第二个也是只改一处
其余的我看下,之后回复你

user5367314:

回复 Kevin Qiu1:

1.关于第24条的修改:

修改为i = (gMAX_NWK_SEC_MATERIAL_TABLE_ENTRIES – 1); // ADD THIS LINE

请问这里的修改是修改协调器还是终端还是都要修改?

YiKai Chen:

回复 user5367314:

基本上就把所有的補釘都打上去你不用去管协调器还是终端是不是都要修改,你編譯的時候選好要协调器还是终端就行了

user5367314:

回复 YiKai Chen:

关于第18条的修改:

In ZDApp_ProcessNetworkJoin of ZDApp.c, remove NLME_SetPollRate( zgRejoinPollRate ); from if
(nwkStatus == ZSuccess) and place in the else statement instead. One must also set the
zgRejoinPollRate when device state is DEV_END_DEVICE_UNAUTH

1. remove NLME_SetPollRate( zgRejoinPollRate ); from if
(nwkStatus == ZSuccess) and place in the else statement instead.
NLME_SetPollRate( zgRejoinPollRate )放在else的什么位置?

2.One must also set the
zgRejoinPollRate when device state is DEV_END_DEVICE_UNAUTH

这个具体怎么设置呢?

3.Optimally, also place NLME_SetPollRate( ZDApp_SavedPollRate ); inside of ZDO_JoinConfirmCB

NLME_SetPollRate( ZDApp_SavedPollRate );放在ZDO_JoinConfirmCB的哪个位置?

YiKai Chen:

回复 user5367314:

1&2

if ( ZG_SECURE_ENABLED && ( ZDApp_RestoreNwkKey( TRUE ) == false ) ){//if ( ZSTACK_END_DEVICE_BUILD )//{//NLME_SetPollRate( zgRejoinPollRate );//}// wait for auth from trust centerZDApp_ChangeState( DEV_END_DEVICE_UNAUTH );bdb_nwkAssocAttemt(TRUE);}
...if (nwkStatus == ZSuccess){//When the device has successfully rejoined then reset retryCntretryCnt = 0;// Verify NWK key is available before sending Device_annceif ( ZG_SECURE_ENABLED && ( ZDApp_RestoreNwkKey( TRUE ) == false ) ){//加在這if ( ZSTACK_END_DEVICE_BUILD ){NLME_SetPollRate( zgRejoinPollRate );}// wait for auth from trust centerZDApp_ChangeState( DEV_END_DEVICE_UNAUTH );// Start the reset timer for MAX UNAUTH timeZDApp_ResetTimerStart( MAX_DEVICE_UNAUTH_TIMEOUT );}

3. ZDO_JoinConfirmCB的最後一行就可以

Kevin Qiu1:

回复 user5367314:

你的协调器2538、终端2530是不同的平台,所以二者都需要修改

user5367314:

回复 YiKai Chen:

In ZDApp_ProcessNetworkJoin of ZDApp.c, remove NLME_SetPollRate( zgRejoinPollRate ); from if
(nwkStatus == ZSuccess) and place in the else statement instead. One must also set the
zgRejoinPollRate when device state is DEV_END_DEVICE_UNAUTH
关于上面一句话的理解,还是不太明白,是不是下面函数的两个地方都要修改?
下面的函数有两个地方都有if ( nwkStatus == ZSuccess )
void ZDApp_ProcessNetworkJoin( void )
{
if ( (devState == DEV_NWK_JOINING) ||
((devState == DEV_NWK_ORPHAN) &&
(ZDO_Config_Node_Descriptor.LogicalType == NODETYPE_ROUTER)) )
{
// Result of a Join attempt by this device.
if ( nwkStatus == ZSuccess )
{
osal_set_event( ZDAppTaskID, ZDO_STATE_CHANGE_EVT );#if defined ( POWER_SAVING )
osal_pwrmgr_device( PWRMGR_BATTERY );
#endifif ( ZG_SECURE_ENABLED && ( ZDApp_RestoreNwkKey( TRUE ) == false ) )
{
if ( ZSTACK_END_DEVICE_BUILD )
{
NLME_SetPollRate( zgRejoinPollRate );//这里注释吗?
}
// wait for auth from trust center
ZDApp_ChangeState( DEV_END_DEVICE_UNAUTH );bdb_nwkAssocAttemt(TRUE);
}
else
{
if ( ZSTACK_ROUTER_BUILD )
{
if ( devState == DEV_NWK_ORPHAN
&& ZDO_Config_Node_Descriptor.LogicalType != NODETYPE_DEVICE )
{
// Change NIB state to router for restore
_NIB.nwkState = NWK_ROUTER;
}
}if ( devState == DEV_NWK_JOINING )
{
ZDApp_AnnounceNewAddress();
if( bdbCommissioningProcedureState.bdbCommissioningState == BDB_COMMISSIONING_STATE_TL )
{
bdb_setNodeIsOnANetwork(TRUE);
bdb_reportCommissioningState( BDB_COMMISSIONING_STATE_TL, TRUE );
}
}ZDApp_ChangeState( DEV_END_DEVICE );if ( ZSTACK_ROUTER_BUILD )
{
// NOTE: first two parameters are not used, see NLMEDE.h for details
if ( ZDO_Config_Node_Descriptor.LogicalType != NODETYPE_DEVICE )
{
NLME_StartRouterRequest( 0, 0, false );
}
}
}
}
else
{bdb_nwkAssocAttemt(FALSE);NLME_SetPollRate( zgRejoinPollRate );//这里添加?
}
}
else if ( devState == DEV_NWK_ORPHAN ||
devState == DEV_NWK_SEC_REJOIN_CURR_CHANNEL ||
devState == DEV_NWK_TC_REJOIN_CURR_CHANNEL ||
devState == DEV_NWK_TC_REJOIN_ALL_CHANNEL ||
devState == DEV_NWK_SEC_REJOIN_ALL_CHANNEL )
{
// results of an orphaning attempt by this device
if (nwkStatus == ZSuccess)
{
//When the device has successfully rejoined then reset retryCnt
retryCnt = 0;// Verify NWK key is available before sending Device_annce
if ( ZG_SECURE_ENABLED && ( ZDApp_RestoreNwkKey( TRUE ) == false ) )
{
if ( ZSTACK_END_DEVICE_BUILD )
{
NLME_SetPollRate( zgRejoinPollRate );//这里注释?
}
// wait for auth from trust center
ZDApp_ChangeState( DEV_END_DEVICE_UNAUTH );// Start the reset timer for MAX UNAUTH time
ZDApp_ResetTimerStart( MAX_DEVICE_UNAUTH_TIMEOUT );
}
else
{
ZDApp_ChangeState( DEV_END_DEVICE );osal_stop_timerEx( ZDAppTaskID, ZDO_REJOIN_BACKOFF );// setup Power Manager Device
#if defined ( POWER_SAVING )
osal_pwrmgr_device( PWRMGR_BATTERY );
#endif// The receiver is on, turn network layer polling off.
if ( ZDO_Config_Node_Descriptor.CapabilityFlags & CAPINFO_RCVR_ON_IDLE )
{
// if Child Table Management process is not enabled
if ( zgChildAgingEnable == FALSE )
{
NLME_SetPollRate( 0 );
NLME_SetQueuedPollRate( 0 );
NLME_SetResponseRate( 0 );
}
}if ( ZSTACK_ROUTER_BUILD )
{
// NOTE: first two parameters are not used, see NLMEDE.h for details
if ( ZDO_Config_Node_Descriptor.LogicalType != NODETYPE_DEVICE )
{
NLME_StartRouterRequest( 0, 0, false );
}
}ZDApp_AnnounceNewAddress();
}
}
else
{
if ( devStartMode == MODE_RESUME )
{
if ( ++retryCnt <= MAX_RESUME_RETRY )
{
if ( _NIB.nwkPanId == 0xFFFF )
devStartMode = MODE_JOIN;
else
{
devStartMode = MODE_REJOIN;
_tmpRejoinState = true;
prevDevState = DEV_NWK_SEC_REJOIN_CURR_CHANNEL;
}
}
// Do a normal join to the network after certain times of rejoin retries
else if( AIB_apsUseInsecureJoin == true )
{
devStartMode = MODE_JOIN;
}
}
else if(devStartMode == MODE_REJOIN)
{
if ( ZSTACK_END_DEVICE_BUILD )
{
devStartMode = MODE_REJOIN;
_tmpRejoinState = true;
_NIB.nwkState = NWK_INIT;
}
}// Clear the neighbor Table and network discovery tables.
nwkNeighborInitTable();
NLME_NwkDiscTerm();if ( ( ( (ZDO_Config_Node_Descriptor.CapabilityFlags & CAPINFO_RCVR_ON_IDLE) == 0 )
|| ( (ZDO_Config_Node_Descriptor.CapabilityFlags & CAPINFO_RCVR_ON_IDLE)
&& (zgChildAgingEnable == TRUE) ) ) && (devStartMode == MODE_REJOIN) )
{
NLME_SetPollRate( zgRejoinPollRate );
}
}NLME_SetPollRate( zgRejoinPollRate );//这里添加?
}
#if defined ( ZIGBEEPRO )
else if ( devState != DEV_HOLD )
{
#ifdef APP_TP2
if(devState == DEV_END_DEVICE_UNAUTH )
{
return;
}
#endif// Assume from address conflict// Notify the network
ZDApp_AnnounceNewAddress();// Notify apps
osal_set_event( ZDAppTaskID, ZDO_STATE_CHANGE_EVT );
}
#endif
}

YiKai Chen:

回复 user5367314:

poll rate 的修改只會套用到END DEVICE,我也已經指示你修改的地方了

user5367314:

回复 YiKai Chen:

上面你是指出了,但是你改的程序跟那个说明的不一样啊?
remove NLME_SetPollRate( zgRejoinPollRate ); from if
(nwkStatus == ZSuccess) and place in the else statement instead. One must also set the
zgRejoinPollRate when device state is DEV_END_DEVICE_UNAUTH
这句话的意思是
if (nwkStatus == ZSuccess)
{NLME_SetPollRate( zgRejoinPollRate );//注释掉
}
else
{
NLME_SetPollRate( zgRejoinPollRate );//加在这里
}
但是你给的程序还是加在if (nwkStatus == ZSuccess)里的啊?
if ( (devState == DEV_NWK_JOINING) ||((devState == DEV_NWK_ORPHAN)&&(ZDO_Config_Node_Descriptor.LogicalType == NODETYPE_ROUTER)) )
和else if ( devState == DEV_NWK_ORPHAN ||devState == DEV_NWK_SEC_REJOIN_CURR_CHANNEL ||devState == DEV_NWK_TC_REJOIN_CURR_CHANNEL ||devState == DEV_NWK_TC_REJOIN_ALL_CHANNEL ||devState == DEV_NWK_SEC_REJOIN_ALL_CHANNEL )这两个if里面都有if (nwkStatus == ZSuccess)语句,都要修改吗?

user5367314:

回复 Kevin Qiu1:

帮忙解答下@Kevin Qiu1@YiKai Chen

赞(0)
未经允许不得转载:TI中文支持网 » 关于zstack 3.0.2的bug修改说明
分享到: 更多 (0)