Bug in Z-Stack?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Bug in Z-Stack?

1,814 次查看
Zap
Contributor I
Hi everybody,
 
looking at this lines of code found in ZDApp.c
 
case ZDO_NWK_DISC_CNF:
  if (devState != DEV_NWK_DISC)
  {
  }
#if !defined ( ZDO_COORDINATOR )
  else if ( (msgPtr[1] == ZDO_SUCCESS ) &&
      ( zdoDiscCounter++ > MAX_DISC_ATTEMPTS ) )
  {
    devState = DEV_NWK_JOINING;
    ...
 
I can't understand why  (zdoDiscCounter++>MAX_DISC_ATTEMPTS).
According to me following this code a device or a router won't join the network unless it recive more than MAX_DISC_ATTEMPTS succesful discoveries notifications.
I changed the statement with (zdoDiscCounter++>MAX_DISC_ATTEMPTS) and it worked well.
Is this a bug or there are any reason to justify this choice?
 
Thanks!
标签 (1)
0 项奖励
回复
1 回复

329 次查看
Zap
Contributor I
sorry, cut&paste error!
 
I meant I use this expression:
 
(zdoDiscCounter++<MAX_DISC_ATTEMPTS)
 
 
0 项奖励
回复