fix for repeated loading attempt of non-existent config files
This commit is contained in:
@@ -1015,9 +1015,9 @@ unsigned char BusHandler::getNextScanAddress(unsigned char lastAddress, bool& sc
|
||||
return SYN;
|
||||
}
|
||||
|
||||
void BusHandler::setScanConfigLoaded(unsigned char address, bool completed, string file) {
|
||||
void BusHandler::setScanConfigLoaded(unsigned char address, string file) {
|
||||
m_seenAddresses[address] |= LOAD_INIT;
|
||||
if (completed) {
|
||||
if (!file.empty()) {
|
||||
m_seenAddresses[address] |= LOAD_DONE;
|
||||
m_loadedFiles[address] = file;
|
||||
}
|
||||
|
||||
@@ -438,10 +438,9 @@ public:
|
||||
/**
|
||||
* Set the state of the participant to configuration @a LOADED.
|
||||
* @param address the slave address.
|
||||
* @param completed true when loading was completed.
|
||||
* @param file the file from which the configuration was loaded.
|
||||
* @param file the file from which the configuration was loaded, or empty if loading was not possible.
|
||||
*/
|
||||
void setScanConfigLoaded(unsigned char address, bool completed, string file);
|
||||
void setScanConfigLoaded(unsigned char address, string file);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -128,7 +128,6 @@ void MainLoop::run()
|
||||
else {
|
||||
scanned = true;
|
||||
logInfo(lf_main, "scan config %2.2x message received", lastScanAddress);
|
||||
m_busHandler->setScanConfigLoaded(lastScanAddress, false, "");
|
||||
}
|
||||
}
|
||||
if (scanned) {
|
||||
@@ -136,7 +135,9 @@ void MainLoop::run()
|
||||
result_t result = loadScanConfigFile(m_messages, lastScanAddress, slave, file);
|
||||
if (result==RESULT_OK) {
|
||||
logInfo(lf_main, "scan config %2.2x: file %s loaded", lastScanAddress, file.c_str());
|
||||
m_busHandler->setScanConfigLoaded(lastScanAddress, true, file);
|
||||
m_busHandler->setScanConfigLoaded(lastScanAddress, file);
|
||||
} else {
|
||||
m_busHandler->setScanConfigLoaded(lastScanAddress, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user