On Mon, Apr 7, 2008 at 4:23 AM, vinutha shankar <[EMAIL PROTECTED]> wrote:
> hi,
>   i wanted an integer to hav number of children a node has and its
>  cluster id.im using surge application.as each mode id is unique, i
>  used parentaddr as CH id and i added a function getnoofchildren in
>  routecontrol interface and implemented in MultihopLEPSM module whose
>  code is as below
>
>  command uint8_t RouteControl.getnoofchildren()   //inserted one
>  {
>    uint8_t i,c=0;
>
>  for (i = 0;i < ROUTE_TABLE_SIZE;i++) {
>         if (NeighborTbl[i].flags) {
>                    if(NeighborTbl[i].parent==TOS_LOCAL_ADDRESS)
>                      {
>                         c++;
>                      }
>                                    }
>
>                                   }
>  dbg(DBG_TEMP,"no of children of node 0x%x are 0x%x\n",TOS_LOCAL_ADDRESS,c);
>     return c;
>  }
>
>  i wanted to know if the approach is correct .and also where to add
>  aggregation functionality as i need clustering and aggregation in my
>  application.I would be thankful if you could help me.

I think you are on the right track although you are not done yet. You
should start testing your code. To do that, you can setup a simple
topology with three nodes - one root and two other nodes connected
with the root. Then you can look at the debug output from the root to
see if the root says it has two children. Then, you can setup a
topology with the root and 30 direct neighbors, and your technique
will run into some problems there...

Aggregation point will depend on the protocol you are trying to build.

- om_p
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to