added result code for invalid address

This commit is contained in:
john30
2014-12-14 18:09:16 +01:00
parent 848a043f8b
commit 2af6e55505
2 changed files with 15 additions and 13 deletions
+4 -3
View File
@@ -25,9 +25,9 @@ using namespace std;
const char* getResultCode(result_t resultCode) {
switch (resultCode) {
case RESULT_OK: return "success";
case RESULT_IN_ESC: return "success: escape sequence received";
case RESULT_SYN: return "success: SYN received";
case RESULT_EMPTY: return "success: empty";
case RESULT_IN_ESC: return "escape sequence received";
case RESULT_SYN: return "SYN received";
case RESULT_EMPTY: return "empty";
case RESULT_ERR_GENERIC_IO: return "ERR: generic I/O error";
case RESULT_ERR_DEVICE: return "ERR: generic device error";
case RESULT_ERR_SEND: return "ERR: send error";
@@ -37,6 +37,7 @@ const char* getResultCode(result_t resultCode) {
case RESULT_ERR_EOF: return "ERR: end of input reached";
case RESULT_ERR_INVALID_ARG: return "ERR: invalid argument";
case RESULT_ERR_INVALID_NUM: return "ERR: invalid numeric argument";
case RESULT_ERR_INVALID_ADDR: return "ERR: invalid address";
case RESULT_ERR_INVALID_POS: return "ERR: invalid position";
case RESULT_ERR_OUT_OF_RANGE: return "ERR: argument value out of valid range";
case RESULT_ERR_INVALID_PART: return "ERR: invalid part type value";
+11 -10
View File
@@ -36,17 +36,18 @@ static const int RESULT_ERR_NOTFOUND = -6; // file/element not found or not
static const int RESULT_ERR_EOF = -7; // end of input reached
static const int RESULT_ERR_INVALID_ARG = -8; // invalid argument
static const int RESULT_ERR_INVALID_NUM = -9; // invalid numeric argument
static const int RESULT_ERR_INVALID_POS = -10; // invalid position
static const int RESULT_ERR_OUT_OF_RANGE = -11; // argument value out of valid range
static const int RESULT_ERR_INVALID_PART = -12; // invalid part type value
static const int RESULT_ERR_MISSING_TYPE = -13; // missing data type
static const int RESULT_ERR_INVALID_LIST = -14; // invalid value list
static const int RESULT_ERR_DUPLICATE = -15; // duplicate entry
static const int RESULT_ERR_INVALID_ADDR = -10; // invalid address
static const int RESULT_ERR_INVALID_POS = -11; // invalid position
static const int RESULT_ERR_OUT_OF_RANGE = -12; // argument value out of valid range
static const int RESULT_ERR_INVALID_PART = -13; // invalid part type value
static const int RESULT_ERR_MISSING_TYPE = -14; // missing data type
static const int RESULT_ERR_INVALID_LIST = -15; // invalid value list
static const int RESULT_ERR_DUPLICATE = -16; // duplicate entry
static const int RESULT_ERR_BUS_LOST = -16; // arbitration lost
static const int RESULT_ERR_CRC = -17; // CRC error
static const int RESULT_ERR_ACK = -18; // ACK error
static const int RESULT_ERR_NAK = -19; // NAK received
static const int RESULT_ERR_BUS_LOST = -17; // arbitration lost
static const int RESULT_ERR_CRC = -18; // CRC error
static const int RESULT_ERR_ACK = -19; // ACK error
static const int RESULT_ERR_NAK = -20; // NAK received
/** type for result code. */
typedef int result_t;