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