diff --git a/lib/logger.cpp b/lib/logger.cpp index 11b8ac16..ccfe11a5 100644 --- a/lib/logger.cpp +++ b/lib/logger.cpp @@ -45,7 +45,7 @@ int calcAreas(const std::string areas) for (std::vector::iterator it = cmd.begin() ; it != cmd.end(); ++it) for (int i = 0; i < Size_of_Areas; i++) { - if (strcasecmp("all", it->c_str()) == 0) + if (strcasecmp("ALL", it->c_str()) == 0) return (pow(2, (int)Size_of_Areas) - 1); if (strcasecmp(AreaNames[i], it->c_str()) == 0) diff --git a/src/baseloop.cpp b/src/baseloop.cpp index a4864e75..6dfcfcec 100644 --- a/src/baseloop.cpp +++ b/src/baseloop.cpp @@ -75,7 +75,7 @@ void BaseLoop::start() L.log(bas, event, ">>> %s", data.c_str()); // decode message - if (strcasecmp(data.c_str(), "stop") != 0) + if (strcasecmp(data.c_str(), "STOP") != 0) result = decodeMessage(data); else result = "done"; @@ -90,7 +90,7 @@ void BaseLoop::start() delete message; // stop daemon - if (strcasecmp(data.c_str(), "stop") == 0) + if (strcasecmp(data.c_str(), "STOP") == 0) return; } } @@ -281,8 +281,8 @@ std::string BaseLoop::decodeMessage(const std::string& data) break; } - if (strcasecmp(cmd[1].c_str(), "on") == 0) m_ebusloop->dump(true); - if (strcasecmp(cmd[1].c_str(), "off") == 0) m_ebusloop->dump(false); + if (strcasecmp(cmd[1].c_str(), "ON") == 0) m_ebusloop->dump(true); + if (strcasecmp(cmd[1].c_str(), "OFF") == 0) m_ebusloop->dump(false); result << "done"; break; @@ -294,13 +294,13 @@ std::string BaseLoop::decodeMessage(const std::string& data) } // ToDo: check for possible areas and level - if (strcasecmp(cmd[1].c_str(), "areas") == 0) { + if (strcasecmp(cmd[1].c_str(), "AREAS") == 0) { L.getSink(0)->setAreas(calcAreas(cmd[2])); result << "done"; break; } - if (strcasecmp(cmd[1].c_str(), "level") == 0) { + if (strcasecmp(cmd[1].c_str(), "LEVEL") == 0) { L.getSink(0)->setLevel(calcLevel(cmd[2])); result << "done"; break; @@ -319,12 +319,12 @@ std::string BaseLoop::decodeMessage(const std::string& data) } // ToDo: ... - if (strcasecmp(cmd[1].c_str(), "list") == 0) { + if (strcasecmp(cmd[1].c_str(), "LIST") == 0) { result << "not implemented yet"; break; } - if (strcasecmp(cmd[1].c_str(), "reload") == 0) { + if (strcasecmp(cmd[1].c_str(), "RELOAD") == 0) { // create Commands DB Commands* commands = ConfigCommands(A.getParam("p_ebusconfdir"), CSV).getCommands(); L.log(bas, debug, "ebus configuration dir: %s", A.getParam("p_ebusconfdir")); diff --git a/src/baseloop.h b/src/baseloop.h index 52316681..495e9fff 100644 --- a/src/baseloop.h +++ b/src/baseloop.h @@ -59,14 +59,14 @@ private: ClientCommand getCase(const std::string& item) { - if (strcasecmp(item.c_str(), "get") == 0) return get; - if (strcasecmp(item.c_str(), "set") == 0) return set; - if (strcasecmp(item.c_str(), "cyc") == 0) return cyc; - if (strcasecmp(item.c_str(), "hex") == 0) return hex; - if (strcasecmp(item.c_str(), "dump") == 0) return dump; - if (strcasecmp(item.c_str(), "log") == 0) return log; - if (strcasecmp(item.c_str(), "config") == 0) return config; - if (strcasecmp(item.c_str(), "help") == 0) return help; + if (strcasecmp(item.c_str(), "GET") == 0) return get; + if (strcasecmp(item.c_str(), "SET") == 0) return set; + if (strcasecmp(item.c_str(), "CYC") == 0) return cyc; + if (strcasecmp(item.c_str(), "HEX") == 0) return hex; + if (strcasecmp(item.c_str(), "DUMP") == 0) return dump; + if (strcasecmp(item.c_str(), "LOG") == 0) return log; + if (strcasecmp(item.c_str(), "CONFIG") == 0) return config; + if (strcasecmp(item.c_str(), "HELP") == 0) return help; return notfound; }