replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / service / resource-encapsulation / examples / linux / SampleResourceClient.cpp
index cf0ff40..d7336ca 100644 (file)
@@ -87,7 +87,7 @@ int processUserInput(int min = std::numeric_limits<int>::min(),
 {
     assert(min <= max);
 
-    int input;
+    int input = 0;
 
     std::cin >> input;
     std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
@@ -270,9 +270,9 @@ void onResourceStateChanged(ResourceState resourceState)
     }
 }
 
-void onCacheUpdated(const RCSResourceAttributes& attributes)
+void onCacheUpdated(const RCSResourceAttributes& attributes, int eCode)
 {
-    std::cout << "onCacheUpdated callback" << std::endl;
+    std::cout << "onCacheUpdated callback : " << eCode << std::endl;
 
     printAttributes(attributes);
 }
@@ -423,16 +423,16 @@ std::string selectResourceType()
 
     switch (processUserInput(RESOURCE_TEMP, RESOURCE_LIGHT))
     {
-    case RESOURCE_TEMP:
-    {
-        g_attrKey = "Temperature";
-        return RESOURCE_TYPE_TEMP;
-    }
-    case RESOURCE_LIGHT:
-    {
-        g_attrKey = "Brightness";
-        return RESOURCE_TYPE_LIGHT;
-    }
+        case RESOURCE_TEMP:
+        {
+            g_attrKey = "Temperature";
+            return RESOURCE_TYPE_TEMP;
+        }
+        case RESOURCE_LIGHT:
+        {
+            g_attrKey = "Brightness";
+            return RESOURCE_TYPE_LIGHT;
+        }
     }
 
     throw std::logic_error("unreachable");