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:
+9
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user