fix for readonly, immediately give up reading on send error or device error

This commit is contained in:
john30
2015-05-14 11:43:23 +02:00
parent f4d967f3c3
commit 071d57f957
+4 -1
View File
@@ -156,7 +156,7 @@ result_t BusHandler::sendAndWait(SymbolString& master, SymbolString& slave)
if (result == RESULT_OK)
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));
break;
}
@@ -316,6 +316,9 @@ result_t BusHandler::handleSymbol()
else {
sending = false;
timeout = SYN_TIMEOUT;
if (startRequest != NULL && m_nextRequests.remove(startRequest)) {
m_currentRequest = startRequest; // force the failed request to be notified
}
setState(bs_skip, result);
}
}