[Tinyos-devel] CC2420 Send.cancel not working correctly with LPL?

David Moss dmm at rincon.com
Tue Sep 25 18:21:51 PDT 2007


Hi Mischa,

Thanks for bringing this up.  Incidentally, Send.cancel() is not tested in
any of our unit tests for the CC2420 stack.  Obviously it should be, since
the interface is provided.

I'll take a look at the issue and the suggestions you've outlined and commit
a unit tested solution for this problem.

Thanks again,
-David


-----Original Message-----
From: tinyos-devel-bounces at Millennium.Berkeley.EDU
[mailto:tinyos-devel-bounces at Millennium.Berkeley.EDU] On Behalf Of Mischa
Weise
Sent: Tuesday, September 25, 2007 6:09 PM
To: tinyos-devel at Millennium.Berkeley.EDU
Subject: [Tinyos-devel] CC2420 Send.cancel not working correctly with LPL?

Hi,

I think that the Send.cancel() command in the CC2420 LPL implementation 
is not working according to TEP116. If I cancel a packet burst, 
Send.cancel returns SUCCESS, but no Send.sendDone() event is generated 
(not with ECANCEL nor with any other error)

***citing TEP116:
The cancel command allows a sender to cancel the current transmission. A 
call to cancel when there is no pending sendDone event MUST return FAIL. 
If there is a pending sendDone event and the cancel returns SUCCESS, 
then the packet layer MUST NOT transmit the packet and MUST signal 
sendDone with ECANCEL as its error code
***

So if my call to Send.cancel that returns SUCCESS should trigger the 
event Send.sendDone(ECANCEL), which it does not in my example.


As I see it:
- ECANCEL is only generated in CC2420TransmitP(516/547) as en error when 
sending or resending (after Send.cancel() is passed down to it).
- this error is then passed up to CC2420CsmaP as return value of the 
Send.send() command or passed up to CC2420DefaultLplP as return value of 
Send.resend().
-> so actually sendDone(ECANCEL) is never signaled when a transmission 
is canceled??? (especially a resend)


Ideas for a solution:
-> handle this directly in CC2420TransmitP and signal sendDone, when 
there was a Send.cancel() passed down.
-> handle the Send.send() return value ECANCEL in CC2420CsmaP and in 
that case signal Send.sendDone(ECANCEL)
-> perhaps it is better / easier to handle this at the level of 
CC2420DefaultLplP when we cancel in the middle of a packet burst?


I don't know the functions of CC2420TransmitP so well, so how is this 
done correctly?

Any help deeply appreciated,
Mischa
_______________________________________________
Tinyos-devel mailing list
Tinyos-devel at Millennium.Berkeley.EDU
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-devel




More information about the Tinyos-devel mailing list