X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=service%2Fresource-encapsulation%2Fexamples%2Flinux%2FNestedAttributesServer.cpp;h=005e0a51b23f3c0c5f01fd86a37be7fa5c70214f;hb=7f00f942c39b7bc27c7eeecf213a239c3fe4173c;hp=fc579e7ead4a4b4209c001b7bd0a51e44d721933;hpb=cf56a410a2150ae474c676e7e6d01b89552a4873;p=platform%2Fupstream%2Fiotivity.git diff --git a/service/resource-encapsulation/examples/linux/NestedAttributesServer.cpp b/service/resource-encapsulation/examples/linux/NestedAttributesServer.cpp index fc579e7..005e0a5 100644 --- a/service/resource-encapsulation/examples/linux/NestedAttributesServer.cpp +++ b/service/resource-encapsulation/examples/linux/NestedAttributesServer.cpp @@ -28,7 +28,7 @@ constexpr int DEFAULT_SPEED = 30; constexpr int UP_SPEED = 50; constexpr int DOWN_SPEED = 10; -constexpr int DEFALUT_SERVER = 1; +constexpr int DEFAULT_SERVER = 1; constexpr int CUSTOM_SERVER = 2; constexpr int STOP = 3; @@ -223,7 +223,7 @@ void initServer() int processUserInput() { - int userInput; + int userInput = 0; std::cin >> userInput; if (std::cin.fail()) { @@ -263,7 +263,7 @@ int selectServerMenu() { switch (processUserInput()) { - case DEFALUT_SERVER: + case DEFAULT_SERVER: // Creation of Resource & Auto control for all requests from Client. initServer(); return CORRECT_INPUT; @@ -293,15 +293,24 @@ void process() int ret = selectServerMenu(); - if (ret == QUIT) return; - if (ret == CORRECT_INPUT) break; + if (ret == QUIT) + { + return; + } + if (ret == CORRECT_INPUT) + { + break; + } } while (true) { displayControlMenu(); - if (selectControlMenu() == QUIT) return; + if (selectControlMenu() == QUIT) + { + return; + } } } @@ -315,6 +324,10 @@ int main(void) { std::cout << "main exception : " << e.what() << std::endl; } + catch (...) + { + std::cout << "main exception : unknown" << std::endl; + } std::cout << "Stopping the server" << std::endl; }