Bug in Z-Stack?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bug in Z-Stack?

1,783 Views
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!
Labels (1)
0 Kudos
1 Reply

298 Views
Zap
Contributor I
sorry, cut&paste error!
 
I meant I use this expression:
 
(zdoDiscCounter++<MAX_DISC_ATTEMPTS)
 
 
0 Kudos