[Tinyos-help] FW: message received

lucky eyes engr_aqansari at hotmail.com
Tue Nov 2 02:58:01 PDT 2010


 when I tested it on leds then broadcast value is 0.3 but at receiving node it is any -ve value.

From: engr_aqansari at hotmail.com
To: urs.hunkeler at epfl.ch
CC: tinyos-help at millennium.berkeley.edu
Subject: RE: [Tinyos-help] message received
Date: Tue, 2 Nov 2010 07:26:11 +0000









Dear Sir,

After making changes there is nothing displayed in result except 

Random seed is 290003. 


event TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr m) {
    SenseMessage *message = (SenseMessage*)m->data;

                d1 =  message->Pos1;
dbg(DBG_TEMP, "x11 Value is %i\n",(int) d1);
            d2 = message->Pred1 ;
                d3 = message->Succ1;
        
    
    return m;
  }

Actually I am successful to send 3 variables via broadcast message from one node to another node but now i want to assign these values in variables at receiving node.

From: engr_aqansari at hotmail.com
To: urs.hunkeler at epfl.ch
CC: tinyos-help at millennium.berkeley.edu
Subject: RE: [Tinyos-help] message received
Date: Mon, 1 Nov 2010 17:40:24 +0000









Thanks Sir, I am clear now.

> Date: Mon, 1 Nov 2010 15:52:58 +0100
> From: urs.hunkeler at epfl.ch
> To: engr_aqansari at hotmail.com
> CC: tinyos-help at millennium.berkeley.edu
> Subject: Re: [Tinyos-help] message received
> 
> Hi,
> 
> I'm not sure what exactly you want to do here. In the receive method you 
> get a pointer to an object with data you just received. The value you 
> received is e.g., message->value1. With the line "message->value1 -> 
> D1;" you are overwriting this value (you never read it). Finally, you 
> return the pointer to the object with the data, and it will be 
> overwritten in the future when the system receives more messages. This 
> will compile, but has no visible effect.
> 
> If you want to store the data you received into the variable D1, you'll 
> have to write "D1 = message->value1;". This will change the value of D1 
> to the value that you received in the broadcast message.
> 
> Cheers,
> Urs
> 
> 
> On 11/01/2010 03:21 PM, lucky eyes wrote:
> >
> > Hi all,
> >
> > event TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr m) {
> > CounterMessage *message = (CounterMessage*)m->data;
> >
> > message->value1 = D1;
> >
> > message->value2 =D2 ;
> > message->value3 = D3;
> >
> > return m;
> > }
> >
> > D1,D2 and D3 are sent via broadcast in a message.Is it possible to
> > assign these values in value1,value2 and value3?
> >
> > I tried it and there is no error but i don't know It is assigned or not.
> >
> >
> > Best Wishes
> >
> > AQAnsari
> >
> >
> >
> > _______________________________________________
> > Tinyos-help mailing list
> > Tinyos-help at millennium.berkeley.edu
> > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20101102/baa561b7/attachment.htm 


More information about the Tinyos-help mailing list