Hi ,
Packets are 53 bytes long,Transmission rate is 40kbps.The range of
transmitter is 15feet.So propagation delay can be taken as zero.I have to
wait only 1ms and do retransmission if I don't get ACK.
I cannot use the timer method because it fires in intervals of milli
seconds.I have to use this while loop to wait for 1ms.
while( i++ < 1000 )
TOSH_uwait(1); /* wait for 1 micro second */
Still any suggestion ?
Best Regards,
Kishore
On Fri, Aug 1, 2008 at 9:49 PM, Eric Decker <[EMAIL PROTECTED]> wrote:
> I would structure this as follows:
> The sendDone is async? I believe so. From sendDone, change your transmit
> state to ACK PENDING (or
> whatever you want to call it), post a task that starts the retransmit
> timer. If the timer expires fire off the send of
> the retransmission.
>
> In the receiver, if all checks out then change state appropriately and fire
> off the task again which cancels the timer.
>
> 1ms is kind of tight. how big are the packets and what is the transmission
> rate.
>
> eric
>
>
> On Fri, Aug 1, 2008 at 3:55 AM, ram kishore <[EMAIL PROTECTED]> wrote:
>
>> Hi,
>> The problem is exactly like this:
>> ""When the message is send,send.done() event is generated.I start waiting
>> for a packet to be received.If it doesn't come in 1ms,I will re-transmit
>> else I will transmit the next packet.""
>>
>> *Coding part:*
>> In send.done ()
>> {
>> while ( timer <= 1000)
>> {
>> TOSH_uwait(1); //wait for 1microsecond
>> timer++;
>> if ( flag == 1) //flag is a conditional variable;If
>> packet is received,Receive.receive() event will set the flag to 1.
>> {
>> call Leds.yellowToggle();
>> break;
>> }
>> }
>> if ( timer == 1001)
>> post ResendTask();
>> return SUCCESS;
>>
>> }
>>
>>
>> I will transmit the next packet in receive.receive event.
>> Conditional variable is not working in this regard.Any suggestion on
>> different paradigm ?
>>
>> Regards,
>> Kishore
>>
>> On Wed, Jul 30, 2008 at 11:54 PM, Eric Decker <[EMAIL PROTECTED]> wrote:
>> >
>> >
>> > On Wed, Jul 30, 2008 at 10:55 AM, ram kishore <[EMAIL PROTECTED]>
>> wrote:
>> >>
>> >> Hi all,
>> >>
>> >> When ever a packet is received, an event ReceiveMsg.receive(TOS_MsgPtr
>> >> Msg) is generated.Can I detect this in some other event for example in
>> >> send.senddone() event,so that I can perform alternative task.How to
>> >> detect it?
>> >
>> > First I'm not sure what problem you are trying to solve. The
>> description
>> > you
>> > give above sounds complicated. If I understand correctly from the event
>> > handler for send.senddone you want to check to see if a message was
>> > received and do something else. Is that correct? If so it seems
>> simpler
>> > to let the different handlers handler their one thing. Just an aside.
>> > events are signaled from another module and as such are pieces of
>> static
>> > code. As such there isn't a way to detect an event in another event.
>> > That said your alternative sounds like it might work but it depends on
>> what
>> > kind of events, async or not, are being used. And as soon as you start
>> > mixing
>> > async stuff and wanting it to interact with a task level event things
>> get
>> > complicated
>> > quickly.
>> > eric
>> >>
>> >> An alternative to this may be using conditional variables.I declare a
>> >> global variable "flag" as "false".Keep performing some task in
>> >> senddone() event.when a packet is received,receive event generated
>> >> will set the flag as "true", then I will stop doing task in senddone()
>> >> event.Will this work?
>> >>
>> >>
>> >> Best Regards,
>> >> Kishore
>> >> _______________________________________________
>> >> Tinyos-help mailing list
>> >> [email protected]
>> >>
>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>> >
>> >
>> >
>> > --
>> > Eric B. Decker
>> > Senior (over 50 :-) Researcher
>> > Autonomous Systems Lab
>> > Jack Baskin School of Engineering
>> > UCSC
>> >
>> >
>>
>>
>
>
> --
> Eric B. Decker
> Senior (over 50 :-) Researcher
> Autonomous Systems Lab
> Jack Baskin School of Engineering
> UCSC
>
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help