In your surge.nc check which multi hop routing algorithm you are using.
Then go to implementation of that routing algorithm and there you can check
that time syn is implemented or not, there will be parameters give to be set
to synchronize nodes, but I am not sure that will work fine or not, because
there are lot of bugs in multihop routing algorithms.
On 4/10/08, vinutha shankar <[EMAIL PROTECTED]> wrote:
>
> oh ok.but,is there any example for that?.i have no idea about it.
> i inserted this code in AMPromiscous.nc whose receivemsg function is
> used by surge.i wanted to know if the approach is write.plz help me.i
> have assumed number of nodes as 3 just for testing.
> TOS_MsgPtr prom_received(TOS_MsgPtr packet) __attribute__ ((C,
> spontaneous))
> {
> int i,j; //insertedone
> TOS_MHopMsg *m=(TOS_MHopMsg *)(packet->data);
> SurgeMsg *s=(SurgeMsg *)(m->data);
> counter++;
> dbg(DBG_AM, "AM_address = %hx, %hhx; counter:%i\n", packet->addr,
> packet->type, (int)counter);
>
> if (packet->group == TOS_AM_GROUP &&
> (promiscuous_mode == TRUE ||
> packet->addr == TOS_BCAST_ADDR ||
> packet->addr == TOS_LOCAL_ADDRESS) &&
> (crc_check == FALSE || packet->crc == 1))
> {
> uint8_t type = packet->type;
> TOS_MsgPtr tmp;
> dbg(DBG_AM, "Received message:\n\t");
> dbgPacket(packet);
> dbg(DBG_AM, "AM_type = %d\n", type);
>
> for(i=0;i<3;i++) //inserted one
> {
> if(i==TOS_LOCAL_ADDRESS)
> {
> j=arr[i].j;
> arr[i].reading[j]=s->reading;
> arr[i].i=(arr[i].i)+1;
> arr[i].j=(arr[i].j)+1;
> if((arr[i].i)==((s->no_of_children)-1))
> {
> int sum=0,avg,p,l; dbg(DBG_AM,"entered ampromiscous\n");
> for(l=0;l<(arr[i].j);l++)
> sum+=(arr[i].reading[l]);
> avg=sum/(s->no_of_children);
> printf("the average at cluster head %d is
> %d\n",s->my_CH,avg);
> s->reading=avg;
> arr[i].i=0;
> arr[i].j=0;
> for(p=0;p<16;p++)
> arr[i].reading[p]=0;
> }
> }
> }
>
> // dispatch message
> tmp = signal ReceiveMsg.receive[type](packet);
> if (tmp)
> packet = tmp;
> }
> return packet;
> }
>
>
> On 4/10/08, Poonam Hiwal <[EMAIL PROTECTED]> wrote:
> >
> > whenever implementing clustering there must be time synchronization
> > algorithm also be implemented.
> >
> > That you have to check in your code...
> >
> >
> >
> > On 4/10/08, vinutha shankar <[EMAIL PROTECTED]> wrote:
> > > hi,
> > > how do i synchronize all nodes for aggregation?
> > >
> >
> >
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help