Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sendDone error codes #334

Open
Badisso opened this issue Mar 19, 2015 · 5 comments
Open

sendDone error codes #334

Badisso opened this issue Mar 19, 2015 · 5 comments

Comments

@Badisso
Copy link

Badisso commented Mar 19, 2015

Hi All,
It seems there is a mismatch in the error codes returned by the sendDone event (at least for TOSSIM). Thus, the AMSend and Send interfaces specify that sendDone returns FAIL if a transmission has failed (https://github.com/tinyos/tinyos-main/blob/master/tos/interfaces/AMSend.nc#L104). However, TossimPacketModelC.nc for example returns an EBUSY code for such a case (https://github.com/tinyos/tinyos-main/blob/master/tos/lib/tossim/TossimPacketModelC.nc#L245)
I am not sure if it is the case with other platforms, but a quick look to the CC2420TransmitP.nc (https://github.com/tinyos/tinyos-main/blob/master/tos/chips/cc2420/transmit/CC2420TransmitP.nc) seems to not return a FAIL code.
Please share your opinions on the appropriate fix

@gnawali
Copy link
Member

gnawali commented Mar 19, 2015

It is a bug in TOSSIM. EBUSY should be returned only when you call send when there is an outstanding send call, i.e., send was successful but sendDone is not signaled yet.

@Badisso
Copy link
Author

Badisso commented Mar 19, 2015

Yes, as you mentioned EBUSY is returned by the send command. The sendDone as documented in the AMSend and Send interfaces returns SUCCESS, FAIL or ECANCEL. In TOSSIM there might be a possibility for EOFF (https://github.com/tinyos/tinyos-main/blob/master/tos/lib/tossim/TossimPacketModelC.nc#L285). In the CC2420TransmitP it seems another code ERETRY can go up to both Send.sendDone and AMSend.sendDone (https://github.com/tinyos/tinyos-main/blob/master/tos/chips/cc2420/transmit/CC2420TransmitP.nc#L531)

@gnawali
Copy link
Member

gnawali commented Mar 19, 2015

I think we should update the documentation because EOFF and ERETRY are possible return values.

@Badisso
Copy link
Author

Badisso commented Mar 19, 2015

I agree about EOFF, but I think ERETRY should not be returned to upper layers which are more interested to know whether the transmission resulted in a SUCCESS or FAIL at the end.

@gnawali
Copy link
Member

gnawali commented Mar 19, 2015

many other places in the code use ERETRY so the question is in the radio stack -- what is the highest level to which it is appropriate to send ERETRY.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants