From c2317ad6444bd2a90a45fd519f286a7cef49c776 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 4 Dec 2009 13:23:58 +0100 Subject: [PATCH] Update COMSTACK chapter WRT diagnostics --- doc/comstack.xml | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/doc/comstack.xml b/doc/comstack.xml index e951696..0be1936 100644 --- a/doc/comstack.xml +++ b/doc/comstack.xml @@ -541,39 +541,37 @@ if (buf) - When a function (including the data exchange functions) reports an - error condition, use the function - cs_errno() to determine the cause of the - problem. The function + The error code for the COMSTACK can be retrieved using C macro + cs_errno which will return one + of the error codes CSYSERR, + CSOUTSTATE, + CSNODATA, ... - void cs_perror(COMSTACK handle char *message); + int cs_errno(COMSTACK handle); - works like perror(2) and prints the - message argument, along with a system message, to - stderr. Use the character array + You can the textual representation of the error code + by using cs_errmsg - which + works like strerror(3) - extern const char *cs_errlist[]; + const char *cs_errmsg(int n); - + - to get hold of the message, if you want to process it differently. - The function + It is also possible to get straight to the textual represenataion + without the error code by using + cs_strerror. - + - const char *cs_stackerr(COMSTACK handle); + const char *cs_strerror(COMSTACK h); - - - Returns an error message from the lower layer, if one has been - provided. - + Summary and Synopsis -- 1.7.10.4