add dedicated error code for arbitration running
This commit is contained in:
@@ -316,7 +316,7 @@ result_t Device::recv(unsigned int timeout, symbol_t* value, ArbitrationState* a
|
|||||||
|
|
||||||
result_t Device::startArbitration(symbol_t masterAddress) {
|
result_t Device::startArbitration(symbol_t masterAddress) {
|
||||||
if (m_arbitrationCheck) {
|
if (m_arbitrationCheck) {
|
||||||
return RESULT_ERR_SEND; // should not occur
|
return RESULT_ERR_ARB_RUNNING; // should not occur
|
||||||
}
|
}
|
||||||
if (m_readOnly) {
|
if (m_readOnly) {
|
||||||
return RESULT_ERR_SEND;
|
return RESULT_ERR_SEND;
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ const char* getResultCode(result_t resultCode) {
|
|||||||
case RESULT_ERR_DUPLICATE: return "ERR: duplicate entry";
|
case RESULT_ERR_DUPLICATE: return "ERR: duplicate entry";
|
||||||
case RESULT_ERR_DUPLICATE_NAME: return "ERR: duplicate name";
|
case RESULT_ERR_DUPLICATE_NAME: return "ERR: duplicate name";
|
||||||
case RESULT_ERR_BUS_LOST: return "ERR: arbitration lost";
|
case RESULT_ERR_BUS_LOST: return "ERR: arbitration lost";
|
||||||
|
case RESULT_ERR_ARB_RUNNING: return "ERR: arbitration running";
|
||||||
case RESULT_ERR_CRC: return "ERR: CRC error";
|
case RESULT_ERR_CRC: return "ERR: CRC error";
|
||||||
case RESULT_ERR_ACK: return "ERR: ACK error";
|
case RESULT_ERR_ACK: return "ERR: ACK error";
|
||||||
case RESULT_ERR_NAK: return "ERR: NAK received";
|
case RESULT_ERR_NAK: return "ERR: NAK received";
|
||||||
|
|||||||
@@ -56,15 +56,16 @@ enum result_t {
|
|||||||
RESULT_ERR_DUPLICATE_NAME = -17, //!< duplicate entry (name)
|
RESULT_ERR_DUPLICATE_NAME = -17, //!< duplicate entry (name)
|
||||||
|
|
||||||
RESULT_ERR_BUS_LOST = -18, //!< arbitration lost
|
RESULT_ERR_BUS_LOST = -18, //!< arbitration lost
|
||||||
RESULT_ERR_CRC = -19, //!< CRC error
|
RESULT_ERR_ARB_RUNNING = -19, //!< arbitration running
|
||||||
RESULT_ERR_ACK = -20, //!< ACK error
|
RESULT_ERR_CRC = -20, //!< CRC error
|
||||||
RESULT_ERR_NAK = -21, //!< NAK received
|
RESULT_ERR_ACK = -21, //!< ACK error
|
||||||
|
RESULT_ERR_NAK = -22, //!< NAK received
|
||||||
|
|
||||||
RESULT_ERR_NO_SIGNAL = -22, //!< no signal found on the bus
|
RESULT_ERR_NO_SIGNAL = -23, //!< no signal found on the bus
|
||||||
RESULT_ERR_SYN = -23, //!< SYN received instead of answer
|
RESULT_ERR_SYN = -24, //!< SYN received instead of answer
|
||||||
RESULT_ERR_SYMBOL = -24, //!< wrong symbol received instead of sent symbol
|
RESULT_ERR_SYMBOL = -25, //!< wrong symbol received instead of sent symbol
|
||||||
|
|
||||||
RESULT_ERR_NOTAUTHORIZED = -25 //!< not authorized for this action
|
RESULT_ERR_NOTAUTHORIZED = -26 //!< not authorized for this action
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user