[Tinyos-help] - A mote capture and send the message to two other

Michael Schippling schip at santafe.edu
Thu Dec 6 09:40:40 PST 2007


You need to wait for the sendDone() of the first message
before posting the send of the second, do the "post send03()"
for withing sendDone().

MS

Tiago Wanderley wrote:
> Hi,
> 
> first, I would warn that my English is not good. =D
> 
> I'am with problem, captured a date e turn on leds if this value is 
> greater than 0x300. After I sent the value for other two motes, using 
> the tasks send02() and send03(). The task send02() is executed with 
> success, the mote of id 02 receive the message,but the send03 () was not 
> executed, consequently the mote of id 03 has not received the message. 
> Below the part of the code involved:
> 
>   task void send03()
>   {
>     SenseMessage *message3 = (SenseMessage *)data3.data;
>     if (!pending) {
>         atomic {
>             pending = TRUE;
>             message3->value = value;
>         }
>         message3->source = TOS_LOCAL_ADDRESS;
>         if (! call SendMsg.send(03, sizeof(SenseMessage), &data3))      
>        
>             pending = FALSE;
>       }
>   }
>  
>   task void send02()
>   {
>     SenseMessage *message = (SenseMessage *)data.data;
>     if (!pending) {
>         atomic {
>             pending = TRUE;
>             message->value = value;
>         }
>         message->source = TOS_LOCAL_ADDRESS;
>         if (! call SendMsg.send(02, sizeof(SenseMessage), &data))      
>        
>             pending = FALSE;
>       }
>   } 
>  
>   async event result_t ADC.dataReady(uint16_t val) {
>     atomic value = val;
>     post send02();
>     pending = FALSE;
>     post send03();
>     display(val);
>     return SUCCESS;
>   }
> 
> Help-me... =D
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at Millennium.Berkeley.EDU
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

-- 
Platform: WinXP/Cygwin
TinyOS version: 1.x, Boomerang
Programmer: MIB510
Device(s): Mica2, MicaZ, Tmote
Sensor board: homebrew



More information about the Tinyos-help mailing list