I do want it in a queue but i guess I cant use the ForwardEngine component
what this one seems to be doing is take pre-determined packets from a
queue and send them in FIFO order

what I want is some function calls to be executed and a send to be
done after every few of them are done , transmitting as a message the
result of the function call itself
so the second send should actually wait for the packet to be filled
with the result of the process say P2 and  not as in ForwardEngine
where the packets are there and need to be just queued for sending
bcos funtion call P2 depends on P1 , P3 on P2 ( just the process P2 ,
not its send )
that is these are all dependent processes, taking as its input the
result of the previous process execution( &  not its transmission or
reception )

so i dont know if i have a choice other than using multipe send instances
what I think i should be doing is some thing like this :

event 1
{
process P1
send P1
}

P1.senddone
{

process P2
send p2
}

P2.sendone
{
process P3
send P3
}

and so on sequentially

I'm not sure if i have a choice here


Thanks
Bhuvana


On 3/27/07, Philip Levis <[EMAIL PROTECTED]> wrote:
On Mar 27, 2007, at 11:07 AM, Bhuvaneswari Ramkumar wrote:

> Hello all ,
>
> can someone tell me how we can work on sending multiple msgs in
> TinyOS2.0 ?
> I tried both the SerialAmSenderC and the AMSenderAMC component for
> this
> both of them transmit just one msg and the next ones fail
> what I need is for a send to be done every time some function calls
> are executed and some processing  is done
>
> I tried giving multiple instances of the interface used as in
> interface SerialAmSenderC as s1, s2 and s3 for 3 sends respectively
> but here also the s2 and s3 calls fail while s1 executes correctly
>
> I also had a look at the TestSerialC application
> here a timer fires and a send is done every time a timer fires
> Is this the only way to implement it, for a timer to fire a send  ?
> Is it not possible to just plainly invoke AMSend.send at several
> points on the code ?
> If thats the case , I can call multiple one-shot timers to fire after
> every block of processes are finished
>
> I'm also using the listen tool (Listen.java)  to receive the packets
> transmitted
> Here also the listen seems to get the packet only if the program is in
> the form of multiple sends inside a timer-fire event as in TestSerial
> app
>
> for a call from anywhere else, eg : for a send call boot.booted , the
> listener gets nothing
> dont know why this strange thing happens
> any suggestions ?

This is correct. If a call to Send.send() returns SUCCESS, then
subsequent calls will return FAIL until the Send.sendDone() is signaled.

Basically, it sounds like what you want is a queue. Note that
Send.send() does NOT copy the packet. You should not touch a packet
passed to Send.send() until the sendDone() is signaled. So if you
call Send.send() passing a message_t m, then modify m, it is very
possible that you may prevent the packet from being received
successfully, as the CRC may no longer match.

There was some discussion on this a month or so ago. Take a look at
tos/lib/net/ctp/CtpForwardingEngineP.nc. This component maintains a
queue of packets to send. On the sendDone event, it pulls the next
packet out the queue and calls send() with it. Writing an
implementation of the AMSend or Send interfaces that can have
multiple outstanding sends is a bad idea, as it makes writing code
for them very difficult: a calling component has to consider both
cases (single-send and multi-send), increasing its complexity and
probability of bugs. In TinyOS 1.x, the component with the largest
number of bug reports and bug fixes is QueuedSend.

Phil

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

Reply via email to