Do you every initialize msg_buffer to point to an actual message?

You need something like:

TOS_Msg      buffer;
TOS_MsgPtr msg_buffer;

command result_t StdControl.init() {
   msg_buffer = &buffer;
}

On 9/6/06, Hari Hara Sudhan <[EMAIL PROTECTED]> wrote:

Hi every one,

I have a problem with swapping tos message buffer

I have to develop an application which has to receive a TOS Message through
air and then Broad cast the message.

The code is

           TOS_MsgPtr msg_buff;

            event TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr m)
            {
                        TOS_MsgPtr tmp=msg_buff;

                        msg_buff=m;

                        call Leds.greenToggle();
                        post SendData();

                        return tmp;
            }

Basically im performing the buffer swap operation. But the problem is I can
receive only the first Message.

I think there is some problem with the buffer swap. Can any one please help
me regarding this.

Thanking you in advance

R.Hari Hara Sudhan

_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to