treat empty result as valid

This commit is contained in:
john30
2015-03-12 23:40:34 +01:00
parent 16febf3555
commit f1be064dda
+3 -3
View File
@@ -73,7 +73,7 @@ bool PollRequest::notify(result_t result, SymbolString& slave)
if (result == RESULT_OK) { if (result == RESULT_OK) {
result = m_message->decode(pt_slaveData, slave, output); // decode data result = m_message->decode(pt_slaveData, slave, output); // decode data
} }
if (result != RESULT_OK) if (result < RESULT_OK)
logError(lf_bus, "poll %s %s failed: %s", m_message->getClass().c_str(), m_message->getName().c_str(), getResultCode(result)); logError(lf_bus, "poll %s %s failed: %s", m_message->getClass().c_str(), m_message->getName().c_str(), getResultCode(result));
else else
logNotice(lf_bus, "poll %s %s: %s", m_message->getClass().c_str(), m_message->getName().c_str(), output.str().c_str()); logNotice(lf_bus, "poll %s %s: %s", m_message->getClass().c_str(), m_message->getName().c_str(), output.str().c_str());
@@ -102,7 +102,7 @@ bool ScanRequest::notify(result_t result, SymbolString& slave)
scanResult << hex << setw(2) << setfill('0') << static_cast<unsigned>(dstAddress) << UI_FIELD_SEPARATOR; scanResult << hex << setw(2) << setfill('0') << static_cast<unsigned>(dstAddress) << UI_FIELD_SEPARATOR;
result = m_message->decode(pt_slaveData, slave, scanResult, append); // decode data result = m_message->decode(pt_slaveData, slave, scanResult, append); // decode data
} }
if (result != RESULT_OK) { if (result < RESULT_OK) {
logError(lf_bus, "scan %2.2x failed: %s", dstAddress, getResultCode(result)); logError(lf_bus, "scan %2.2x failed: %s", dstAddress, getResultCode(result));
return false; return false;
} }
@@ -718,7 +718,7 @@ void BusHandler::receiveCompleted()
string name = message->getName(); string name = message->getName();
ostringstream output; ostringstream output;
result_t result = message->decode(m_command, m_response, output); result_t result = message->decode(m_command, m_response, output);
if (result != RESULT_OK) if (result < RESULT_OK)
logError(lf_update, "unable to parse %s %s from %s / %s: %s", clazz.c_str(), name.c_str(), m_command.getDataStr().c_str(), m_response.getDataStr().c_str(), getResultCode(result)); logError(lf_update, "unable to parse %s %s from %s / %s: %s", clazz.c_str(), name.c_str(), m_command.getDataStr().c_str(), m_response.getDataStr().c_str(), getResultCode(result));
else { else {
string data = output.str(); string data = output.str();