fix for repeated loading attempt of non-existent config files

This commit is contained in:
john30
2016-01-06 21:42:12 +01:00
parent 6b7b614f28
commit fae726f52d
3 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -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;
}
+2 -3
View 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:
+3 -2
View File
@@ -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, "");
}
}
}