added not authorized code

This commit is contained in:
john30
2017-02-18 11:23:07 +01:00
parent 122b725478
commit 37e2a77d93
2 changed files with 29 additions and 26 deletions
+1
View File
@@ -49,6 +49,7 @@ const char* getResultCode(result_t resultCode) {
case RESULT_ERR_NAK: return "ERR: NAK received";
case RESULT_ERR_NO_SIGNAL: return "ERR: no signal";
case RESULT_ERR_SYN: return "ERR: SYN received";
case RESULT_ERR_NOTAUTHORIZED: return "ERR: not authorized";
default:
if (resultCode >= 0) {
+28 -26
View File
@@ -31,37 +31,39 @@ namespace ebusd {
/** type for result code. */
enum result_t {
RESULT_OK = 0, //!< success
RESULT_OK = 0, //!< success
RESULT_CONTINUE = 1, //!< more input data is needed (e.g. start of escape sequence received)
RESULT_EMPTY = 2, //!< empty result
RESULT_CONTINUE = 1, //!< more input data is needed (e.g. start of escape sequence received)
RESULT_EMPTY = 2, //!< empty result
RESULT_ERR_GENERIC_IO = -1, //!< generic I/O error (usually fatal)
RESULT_ERR_DEVICE = -2, //!< generic device error (usually fatal)
RESULT_ERR_SEND = -3, //!< send error
RESULT_ERR_ESC = -4, //!< invalid escape sequence
RESULT_ERR_TIMEOUT = -5, //!< read timeout
RESULT_ERR_GENERIC_IO = -1, //!< generic I/O error (usually fatal)
RESULT_ERR_DEVICE = -2, //!< generic device error (usually fatal)
RESULT_ERR_SEND = -3, //!< send error
RESULT_ERR_ESC = -4, //!< invalid escape sequence
RESULT_ERR_TIMEOUT = -5, //!< read timeout
RESULT_ERR_NOTFOUND = -6, //!< file/element not found or not readable
RESULT_ERR_EOF = -7, //!< end of input reached
RESULT_ERR_INVALID_ARG = -8, //!< invalid argument
RESULT_ERR_INVALID_NUM = -9, //!< invalid numeric argument
RESULT_ERR_INVALID_ADDR = -10, //!< invalid address
RESULT_ERR_INVALID_POS = -11, //!< invalid position
RESULT_ERR_OUT_OF_RANGE = -12, //!< argument value out of valid range
RESULT_ERR_INVALID_PART = -13, //!< invalid part type value
RESULT_ERR_MISSING_TYPE = -14, //!< missing data type
RESULT_ERR_INVALID_LIST = -15, //!< invalid value list
RESULT_ERR_DUPLICATE = -16, //!< duplicate entry
RESULT_ERR_DUPLICATE_NAME = -17,//!< duplicate entry (name)
RESULT_ERR_NOTFOUND = -6, //!< file/element not found or not readable
RESULT_ERR_EOF = -7, //!< end of input reached
RESULT_ERR_INVALID_ARG = -8, //!< invalid argument
RESULT_ERR_INVALID_NUM = -9, //!< invalid numeric argument
RESULT_ERR_INVALID_ADDR = -10, //!< invalid address
RESULT_ERR_INVALID_POS = -11, //!< invalid position
RESULT_ERR_OUT_OF_RANGE = -12, //!< argument value out of valid range
RESULT_ERR_INVALID_PART = -13, //!< invalid part type value
RESULT_ERR_MISSING_TYPE = -14, //!< missing data type
RESULT_ERR_INVALID_LIST = -15, //!< invalid value list
RESULT_ERR_DUPLICATE = -16, //!< duplicate entry
RESULT_ERR_DUPLICATE_NAME = -17, //!< duplicate entry (name)
RESULT_ERR_BUS_LOST = -18, //!< arbitration lost
RESULT_ERR_CRC = -19, //!< CRC error
RESULT_ERR_ACK = -20, //!< ACK error
RESULT_ERR_NAK = -21, //!< NAK received
RESULT_ERR_BUS_LOST = -18, //!< arbitration lost
RESULT_ERR_CRC = -19, //!< CRC error
RESULT_ERR_ACK = -20, //!< ACK error
RESULT_ERR_NAK = -21, //!< NAK received
RESULT_ERR_NO_SIGNAL = -22, //!< no signal found on the bus
RESULT_ERR_SYN = -23, //!< SYN received instead of answer
RESULT_ERR_NO_SIGNAL = -22, //!< no signal found on the bus
RESULT_ERR_SYN = -23, //!< SYN received instead of answer
RESULT_ERR_NOTAUTHORIZED = -24 //!< not authorized for this action
};