[Tinyos-devel] ENOMEM in TinyError.h
Philip Levis
pal at cs.stanford.edu
Tue May 6 09:55:48 PDT 2008
On May 6, 2008, at 9:46 AM, Miklos Maroti wrote:
> Hi All,
>
> We should not increase the number of faulire codes, because then other
> code need to be aware of more error codes, especially if intermediate
> components blindly pass out internal errors to the caller. We already
> need complicated error handling logic at certain places, and with more
> error codes this just gets worse. So please try to use FAIL or ESIZE.
>
> The real question should be: what actions do you think the caller is
> going to do based on the return value. I can see the following usage
> scenarios:
>
> SUCCESS: memory was allocated
> EBUSY: call me back shortly because I am busy, and then I will process
> your request
> ESIZE or FAIL: have no or too little memory, you should try to live
> with this
>
> By the same token, I do not see the difference between EBUSY and
> ERETRY: the user should do the same no?
The semantics of an error code are not independent of the interface
issuing them.
EBUSY denotes that the component was in the middle of doing something;
ERETRY, in contrast, can just denote that something went wrong and you
should retry. I'd be surprised for EBUSY to be signaled in a
completion event, while the one use of ERETRY is in the CC2420 stack,
when something goes wrong and it doesn't get an SFD on transmission.
Phil
More information about the Tinyos-devel
mailing list