simplified
This commit is contained in:
@@ -570,8 +570,7 @@ result_t BusHandler::handleSymbol()
|
||||
return setState(bs_skip, RESULT_ERR_ACK);
|
||||
|
||||
case bs_sendCmd:
|
||||
if (m_currentRequest != NULL && sending) {
|
||||
if (recvSymbol == sendSymbol) {
|
||||
if (m_currentRequest != NULL && sending && recvSymbol == sendSymbol) {
|
||||
// successfully sent
|
||||
m_nextSendPos++;
|
||||
if (m_nextSendPos >= m_currentRequest->m_master.size()) {
|
||||
@@ -584,12 +583,10 @@ result_t BusHandler::handleSymbol()
|
||||
}
|
||||
return RESULT_OK;
|
||||
}
|
||||
}
|
||||
return setState(bs_skip, RESULT_ERR_INVALID_ARG);
|
||||
|
||||
case bs_sendResAck:
|
||||
if (m_currentRequest != NULL && sending) {
|
||||
if (recvSymbol == sendSymbol) {
|
||||
if (m_currentRequest != NULL && sending recvSymbol == sendSymbol) {
|
||||
// successfully sent
|
||||
if (!m_responseCrcValid) {
|
||||
if (!m_repeat) {
|
||||
@@ -601,7 +598,6 @@ result_t BusHandler::handleSymbol()
|
||||
}
|
||||
return setState(bs_sendSyn, RESULT_OK);
|
||||
}
|
||||
}
|
||||
return setState(bs_skip, RESULT_ERR_INVALID_ARG);
|
||||
|
||||
case bs_sendCmdAck:
|
||||
@@ -646,8 +642,7 @@ result_t BusHandler::handleSymbol()
|
||||
return setState(bs_skip, RESULT_ERR_INVALID_ARG);
|
||||
|
||||
case bs_sendRes:
|
||||
if (sending && m_answer) {
|
||||
if (recvSymbol == sendSymbol) {
|
||||
if (sending && m_answer && recvSymbol == sendSymbol) {
|
||||
// successfully sent
|
||||
m_nextSendPos++;
|
||||
if (m_nextSendPos >= m_response.size()) {
|
||||
@@ -656,16 +651,13 @@ result_t BusHandler::handleSymbol()
|
||||
}
|
||||
return RESULT_OK;
|
||||
}
|
||||
}
|
||||
return setState(bs_skip, RESULT_ERR_INVALID_ARG);
|
||||
|
||||
case bs_sendSyn:
|
||||
if (sending) {
|
||||
if (recvSymbol == sendSymbol) {
|
||||
if (sending && recvSymbol == sendSymbol) {
|
||||
// successfully sent
|
||||
return setState(bs_skip, RESULT_OK);
|
||||
}
|
||||
}
|
||||
return setState(bs_skip, RESULT_ERR_INVALID_ARG);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user