fix for readonly, immediately give up reading on send error or device error
This commit is contained in:
@@ -156,7 +156,7 @@ result_t BusHandler::sendAndWait(SymbolString& master, SymbolString& slave)
|
|||||||
if (result == RESULT_OK)
|
if (result == RESULT_OK)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!success || result == RESULT_ERR_NO_SIGNAL) {
|
if (!success || result == RESULT_ERR_NO_SIGNAL || result == RESULT_ERR_SEND || result == RESULT_ERR_DEVICE) {
|
||||||
logError(lf_bus, "%s, give up", getResultCode(result));
|
logError(lf_bus, "%s, give up", getResultCode(result));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -316,6 +316,9 @@ result_t BusHandler::handleSymbol()
|
|||||||
else {
|
else {
|
||||||
sending = false;
|
sending = false;
|
||||||
timeout = SYN_TIMEOUT;
|
timeout = SYN_TIMEOUT;
|
||||||
|
if (startRequest != NULL && m_nextRequests.remove(startRequest)) {
|
||||||
|
m_currentRequest = startRequest; // force the failed request to be notified
|
||||||
|
}
|
||||||
setState(bs_skip, result);
|
setState(bs_skip, result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user