Piero Zappi

Bug in Z-Stack?

Discussion created by Piero Zappi on Jul 17, 2006
Latest reply on Jul 17, 2006 by Piero Zappi
Hi everybody,
looking at this lines of code found in ZDApp.c
  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?