[IOT-2899][ES] Notifying collection's observers. 55/23355/1
authorSenthil Kumar G S <senthil.gs@samsung.com>
Mon, 20 Nov 2017 06:40:09 +0000 (12:10 +0530)
committerSenthil Kumar G S <senthil.gs@samsung.com>
Mon, 20 Nov 2017 06:47:09 +0000 (12:17 +0530)
When there is an update in the properties of child resources
(WifiConf, CloudConf) of collection(EasySetup),
a notification should be sent to EasySetup's observers.

Change-Id: I9d4d4ab0b0f7e21995d29376819e014c90408d9c
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
service/easy-setup/enrollee/src/resourcehandler.c

index d302a06..f2e821f 100644 (file)
@@ -642,7 +642,12 @@ OCEntityHandlerResult updateWiFiConfResource(OCRepPayload* input)
 
     if (OC_STACK_NO_OBSERVERS == OCNotifyAllObservers(g_ESWiFiConfResource.handle, OC_HIGH_QOS))
     {
-        OIC_LOG(DEBUG, ES_RH_TAG, "Enrollee doesn't have any observer.");
+        OIC_LOG(DEBUG, ES_RH_TAG, "WiFiConf resource doesn't have any observer.");
+    }
+
+    if (OC_STACK_NO_OBSERVERS == OCNotifyAllObservers(g_ESEasySetupResource.handle, OC_HIGH_QOS))
+    {
+        OIC_LOG(DEBUG, ES_RH_TAG, "EasySetup resource doesn't have any observer.");
     }
 
     ehResult = OC_EH_OK;
@@ -738,6 +743,11 @@ void updateCoapCloudConfResource(OCRepPayload* input)
         OIC_LOG(DEBUG, ES_RH_TAG, "CoapCloudConf resource doesn't have any observer.");
     }
 
+    if (OC_STACK_NO_OBSERVERS == OCNotifyAllObservers(g_ESEasySetupResource.handle, OC_HIGH_QOS))
+    {
+        OIC_LOG(DEBUG, ES_RH_TAG, "EasySetup resource doesn't have any observer.");
+    }
+
     OICFree(cloudData);
 }