Yup only the first packet will most likely get through. Another way to do this is to keep a repeatable timer say every 100 ms (enough for one packet to get through) and every time the timer fires to send the subsequent messages


On 7/23/06, Michael Schippling <[EMAIL PROTECTED]> wrote:
You can't do that...

send() doesn't have a queue so only the first message will go out.
The rest, until you get a sendDone(), will be ignored. I beleive the
return value from send() indicates whether it was successful.

The way to send as fast as possible is to post the subsequent send()s
from sendDone().

MS

Nilay Chheda wrote:
> i am trying to broadcast packets back to back. The problem is that most
> of the packets are either lost or are not sent at all.
> the following is the code snippet.
>
>  result_t  sendData(int dest, uint8_t com)
> {
>  if (!pending)
>       {
>     pending = TRUE;
> .
> .
> .
>
>     atomic {
>       message->src = "">>
>       message->dest = dest; // for bcast
>       message->com = com; // for JOIN
>     }
>
>     for(i=0;i<5; i++)
>          {
>                      call Send.send(TOS_BCAST_ADDR, sizeof(IntMsg), &data);
>
>           }
> .
> .
>
> }
>
>
>  event result_t Send.sendDone (TOS_MsgPtr msg, result_t success)
>   {
>
>    if (pending && msg == &data)
>       {
>     pending = FALSE;
>       }
>
>     return SUCCESS;
>   }
>
> Can anybody guide how to avoid packet losses?
>
> Thanks
> Nilay
>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help



--
regards,
Aditya Bhave
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to