GomSpace/libcsp — Issue #23: csp_if_foo/csp_send tx return values
Author: jledet
Created: 2011-11-30 09:47:24+00:00
State: open
Labels: High, Task

Unfortunately, the original version of CSP used 1 to indicate successful transmission in interface tx functions, and 0 to indicate failure. In the name of backward compatibility, this return value has been kept.

The remaining CSP calls return one of the defines from csp_error.h, which use 0 for success, and negative integer error codes. This gives an irregular API, and could lead to confusion since e.g. csp_send(...) == CSP_ERR_NONE is *true* when the transfer *failed*.

We can easily change the interface tx functions to return error codes. I suggest we also change the API for v1.1 so csp_send and interface tx functions return CSP_ERR_NONE on success like the rest of the API.