[Tinyos-devel] AMSend.cancel command clarification request

Philip Levis pal at cs.stanford.edu
Wed Mar 14 21:52:02 PDT 2007


On Mar 14, 2007, at 10:30 AM, Andreas Koepke wrote:

>>
>
> So the MACs for the eyesIFX platform are already 2.0.1 compliant ;-)

:) It's not a compliance issue, really, just an optimization.

>
>> I'm working on an SOSP paper right now, so the earliest I'll be able
>> to fix this later next week. If you come up with  a fix before then,
>> I can take a look and incorporate it into the tree. I think that
>> doing this right will require adding a bit of state for whether a
>> packet is cancelled, posting a a task, and not actually removing the
>> packet until the sendDone(ECANCEL) handler.
>
> If I can rely on the fact that the MAC will also signal a
> sendDone event, then I can get around it. The only catch is
> that a sendDone(ECANCEL) may be signalled while the cancel command is
> called. This should be safe in this case, though.

It definitely should signal a sendDone, and will do so in the release.

>
> I'm attaching a fixed version, where I also introduced some more  
> changes:
> - I changed the nextPacket function to start with current + 1
> (instead of current), I guess that this caused messages to
> be forgotten in the queue.
> - the pointer bug dbg message is moved into the correct branch
> - I removed the additional QUEUE_EMPTY constant, numClients already
> contains this information
> -  and unfortunately some changes in formatting - a side effect of the
> debug instrumentation (that I hopefully removed completely ;-)

Hm. I'm wondering if signaling sendDone from the cancel() command is  
problematic. It breaks one of the programming hints. The other option  
is to keep a bitmask of which packets are cancelled, post a task, and  
cycle through the mask.

Feel free to check in your current version -- you have commit  
privileges, right? It not, let me know. I'll take a look before 2.0.1  
and see if anything might need tweaking.

Phil


More information about the Tinyos-devel mailing list