include undecodable field name in loadScanConfigFile error message and use decimal value of SW/HW field on decode error of any of those two (still experimental due to the message itself still not being decodeable)

This commit is contained in:
john30
2017-01-31 08:05:35 +01:00
parent 15d550024a
commit 81866b7932
+9 -1
View File
@@ -849,13 +849,21 @@ result_t loadScanConfigFile(MessageMap* messages, unsigned char address, SymbolS
out.str("");
offset = (unsigned char)(offset+(*identFields)[field++]->getLength(partType));
result = (*identFields)[field]->read(partType, data, offset, sw, 0); // software version number
if (result==RESULT_ERR_OUT_OF_RANGE) {
sw = (data[(partType==pt_masterData ? 5 : 1)+offset]<<16)|data[(partType==pt_masterData ? 5 : 1)+offset+1];
result = RESULT_OK;
}
}
if (result == RESULT_OK) {
offset = (unsigned char)(offset+(*identFields)[field++]->getLength(partType));
result = (*identFields)[field]->read(partType, data, offset, hw, 0); // hardware version number
if (result==RESULT_ERR_OUT_OF_RANGE) {
hw = (data[(partType==pt_masterData ? 5 : 1)+offset]<<16)|data[(partType==pt_masterData ? 5 : 1)+offset+1];
result = RESULT_OK;
}
}
if (result != RESULT_OK) {
logError(lf_main, "unable to load scan config %2.2x: decode %s", address, getResultCode(result));
logError(lf_main, "unable to load scan config %2.2x: decode field %s %s", address, identFields->getName(field).c_str(), getResultCode(result));
return result;
}
vector<string> files;