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;
|
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;
|
m_seenAddresses[address] |= LOAD_INIT;
|
||||||
if (completed) {
|
if (!file.empty()) {
|
||||||
m_seenAddresses[address] |= LOAD_DONE;
|
m_seenAddresses[address] |= LOAD_DONE;
|
||||||
m_loadedFiles[address] = file;
|
m_loadedFiles[address] = file;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -438,10 +438,9 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Set the state of the participant to configuration @a LOADED.
|
* Set the state of the participant to configuration @a LOADED.
|
||||||
* @param address the slave address.
|
* @param address the slave address.
|
||||||
* @param completed true when loading was completed.
|
* @param file the file from which the configuration was loaded, or empty if loading was not possible.
|
||||||
* @param file the file from which the configuration was loaded.
|
|
||||||
*/
|
*/
|
||||||
void setScanConfigLoaded(unsigned char address, bool completed, string file);
|
void setScanConfigLoaded(unsigned char address, string file);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
@@ -128,7 +128,6 @@ void MainLoop::run()
|
|||||||
else {
|
else {
|
||||||
scanned = true;
|
scanned = true;
|
||||||
logInfo(lf_main, "scan config %2.2x message received", lastScanAddress);
|
logInfo(lf_main, "scan config %2.2x message received", lastScanAddress);
|
||||||
m_busHandler->setScanConfigLoaded(lastScanAddress, false, "");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (scanned) {
|
if (scanned) {
|
||||||
@@ -136,7 +135,9 @@ void MainLoop::run()
|
|||||||
result_t result = loadScanConfigFile(m_messages, lastScanAddress, slave, file);
|
result_t result = loadScanConfigFile(m_messages, lastScanAddress, slave, file);
|
||||||
if (result==RESULT_OK) {
|
if (result==RESULT_OK) {
|
||||||
logInfo(lf_main, "scan config %2.2x: file %s loaded", lastScanAddress, file.c_str());
|
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