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

Mischa Weise mweise at ee.ethz.ch
Tue Sep 25 18:09:13 PDT 2007


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


More information about the Tinyos-devel mailing list