From 7b21cacd41d5be915bb551d436043e946777fccc Mon Sep 17 00:00:00 2001 From: john30 Date: Sun, 1 Nov 2015 23:18:06 +0100 Subject: [PATCH] resolve conditions after reading scan config files --- src/ebusd/main.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ebusd/main.cpp b/src/ebusd/main.cpp index be9e04ea..675b818e 100644 --- a/src/ebusd/main.cpp +++ b/src/ebusd/main.cpp @@ -755,11 +755,17 @@ result_t loadScanConfigFile(MessageMap* messages, unsigned char address, SymbolS templates = it->second; } result = messages->readFromFile(best, templates); - if (result==RESULT_OK) - logNotice(lf_main, "read config file %s for scan %s", best.c_str(), ident.c_str()); - else + if (result!=RESULT_OK) { logError(lf_main, "error reading config file %s for scan %s: %s", best.c_str(), ident.c_str(), getResultCode(result)); - return result; + return result; + } + logNotice(lf_main, "read config file %s for scan %s", best.c_str(), ident.c_str()); + result = messages->resolveConditions(false); + if (result != RESULT_OK) + logError(lf_main, "error resolving conditions: %s, %s", getResultCode(result), messages->getLastError().c_str()); + + logNotice(lf_main, "found messages: %d (%d conditional on %d conditions, %d poll, %d update)", messages->size(), messages->sizeConditional(), messages->sizeConditions(), messages->sizePoll(), messages->sizePassive()); + return RESULT_OK; }