First I think you have to return m in the end of the event. And think about they are pointers,so for example: void swap (int *px, int *py){ int temp; temp=*px; *px=*py; *py=temp; } before you were swapping the copies of the elements. cheers Daniele -----Original Message----- From: Hari Hara Sudhan [mailto:[EMAIL PROTECTED] Sent: Wed 9/6/2006 9:56 AM To: tinyos-help@Millennium.Berkeley.EDU Cc: Subject: [Tinyos-help] Swapping TOS message buffer Problem 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