when I tested it on leds then broadcast value is 0.3 but at receiving node it is any -ve value.
From: [email protected] To: [email protected] CC: [email protected] 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: [email protected] To: [email protected] CC: [email protected] 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: [email protected] > To: [email protected] > CC: [email protected] > 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 > > [email protected] > > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help >
_______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
