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