[ITC][iotcon][ACR-677,682,689][callback return type updated]
authorAsit Srivastava <asit.s@samsung.com>
Thu, 7 Jul 2016 09:55:45 +0000 (15:25 +0530)
committerAsit Srivastava <asit.s@samsung.com>
Thu, 7 Jul 2016 09:55:45 +0000 (15:25 +0530)
Change-Id: Icb1aa071dc1c5214e461c93ac2485704fb728a50
Signed-off-by: Asit Srivastava <asit.s@samsung.com>
src/itc/iotcon/ITs-iotcon-common.h
src/itc/iotcon/ITs-iotcon-device.c
src/itc/iotcon/ITs-iotcon-presence.c
src/itc/iotcon/ITs-iotcon-remote-resource.c
src/itc/iotcon/ITs-iotcon-resource.c

index 13f70fc..3f33b79 100755 (executable)
@@ -56,7 +56,6 @@
 #define ASSIGNVAL2                                     20
 #define ASSIGNVAL3                                     30
 #define IOTCON_FEATURE                 "http://tizen.org/feature/iot.ocf"
-#define IOTCON_SECURITY_FEATURE                "http://tizen.org/feature/iot.ocf.security"
 
 #define LOCAL_HOST_ADDRESS "127.0.0.1"
 #define LIGHT_RESOURCE_TYPE "core.light"
index df4bc06..23f7f03 100755 (executable)
@@ -22,9 +22,9 @@
 * @function            IotconGetDeviceInfoCB
 * @description         Callback Function
 * @parameter           iotcon_device_info_h info, iotcon_error_e result,void *user_data
-* @return                      NA
+* @return                      bool
 */
-static void IotconGetDeviceInfoCB(iotcon_device_info_h info, iotcon_error_e result,void *user_data)
+static bool IotconGetDeviceInfoCB(iotcon_device_info_h info, iotcon_error_e result,void *user_data)
 {
        if ( info == NULL )
        {
@@ -41,15 +41,17 @@ static void IotconGetDeviceInfoCB(iotcon_device_info_h info, iotcon_error_e resu
                g_main_loop_quit(g_pMainLoop);
                g_pMainLoop = NULL;
        }
+       
+       return true;
 }
 
 /**
 * @function            IotconGetPlatformInfoCB
 * @description         Callback Function
 * @parameter           iotcon_platform_info_h info, iotcon_error_e result,void *user_data
-* @return                      NA
+* @return                      bool
 */
-static void IotconGetPlatformInfoCB(iotcon_platform_info_h info,iotcon_error_e result, void *user_data)
+static bool IotconGetPlatformInfoCB(iotcon_platform_info_h info,iotcon_error_e result, void *user_data)
 {
        if ( info == NULL )
        {
@@ -65,6 +67,7 @@ static void IotconGetPlatformInfoCB(iotcon_platform_info_h info,iotcon_error_e r
                g_main_loop_quit(g_pMainLoop);
                g_pMainLoop = NULL;
        }
+       return true;
 }
 
 /**
index ee60a27..c77c8e1 100755 (executable)
@@ -111,9 +111,9 @@ static void presence_handler(iotcon_presence_h presence, iotcon_error_e err,
 * @description         get remote resource clone
 * @parameter           iotcon_remote_resource_h : The remote resource handle, iotcon_error_e : iotcon error
 *                                      user_data : The user data passed from function
-* @return                      NA
+* @return                      bool
 */
-static void presence_found_resource(iotcon_remote_resource_h resource,
+static bool presence_found_resource(iotcon_remote_resource_h resource,
                iotcon_error_e err, void *user_data)
 {
        int nRet;
@@ -132,32 +132,32 @@ static void presence_found_resource(iotcon_remote_resource_h resource,
                {
                        FPRINTF("[Line : %d][%s] iotcon_find_resource fail in startup error returned : %s\\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
                        presence_main_loop_quit(false);
-                       return;
+                       
                }
-               return;
+               return false;
        }
        else if (IOTCON_ERROR_NONE != err)
        {
                presence_main_loop_quit(false);
-               return;
+               return false;
        }
 
        if (g_found)
-               return;
+               return false;
 
        g_found = true;
 
        if(resource == NULL)
        {
                FPRINTF("[Line : %d][%s] iotcon_remote_resource_h is null in presence_found_resource callback. \\n", __LINE__, API_NAMESPACE);
-               return;
+               return false;
        }
 
        nRet = iotcon_remote_resource_get_host_address(resource, &host_address);
        if (IOTCON_ERROR_NONE != nRet) {
                FPRINTF("[Line : %d][%s] Handle iotcon_remote_resource_get_host_address failed: %s\\n", __LINE__, API_NAMESPACE,IotConGetError(nRet));
                presence_main_loop_quit(false);
-               return;
+               return false;
        }
 
        char *uri;
@@ -168,7 +168,7 @@ static void presence_found_resource(iotcon_remote_resource_h resource,
        if (IOTCON_ERROR_NONE != nRet) {
                FPRINTF("[Line : %d][%s] iotcon_remote_resource_get_connectivity_type failed: %s\\n", __LINE__, API_NAMESPACE,IotConGetError(nRet));
                presence_main_loop_quit(false);
-               return;
+               return false;
        }
 
        switch (tc_index)
@@ -180,23 +180,23 @@ static void presence_found_resource(iotcon_remote_resource_h resource,
                        {
                                FPRINTF("[Line : %d][%s] iotcon_add_presence_cb failed: %s\\n", __LINE__, API_NAMESPACE,IotConGetError(nRet));
                                presence_main_loop_quit(false);
-                               return;
+                               return false;
                        }
                        nRet = iotcon_remove_presence_cb(g_presence);
                        if (IOTCON_ERROR_NONE != nRet) {
                                FPRINTF("[Line : %d][%s] iotcon_remove_presence_cb failed: %s\\n", __LINE__, API_NAMESPACE,IotConGetError(nRet));
                                presence_main_loop_quit(false);
-                               return;
+                               return false;
                        }
                        presence_main_loop_quit(true);
-                       return;
+                       return true;
                case PRESENCE_GET_HOST_ADDR_P:
                        nRet = iotcon_add_presence_cb(host_address, conn_type,PRESENCE_LIGHT_RESOURCE_TYPE,presence_handler, NULL, &g_presence);
                        if (IOTCON_ERROR_NONE != nRet)
                        {
                                FPRINTF("[Line : %d][%s] iotcon_add_presence_cb failed: %s\\n", __LINE__, API_NAMESPACE,IotConGetError(nRet));
                                presence_main_loop_quit(false);
-                               return;
+                               return false;
                        }
                        nRet = iotcon_presence_get_host_address(g_presence, &presence_host_address);
                        if (IOTCON_ERROR_NONE != nRet)
@@ -204,18 +204,18 @@ static void presence_found_resource(iotcon_remote_resource_h resource,
                                FPRINTF("[Line : %d][%s] iotcon_presence_get_host_address failed: %s\\n", __LINE__, API_NAMESPACE,IotConGetError(nRet));
                                iotcon_remove_presence_cb(g_presence);
                                presence_main_loop_quit(false);
-                               return;
+                               return false;
                        }
                        iotcon_remove_presence_cb(g_presence);
                        presence_main_loop_quit(true);
-                       return;
+                       return true;
                case PRESENCE_GET_CONN_TYPE_P:
                        nRet = iotcon_add_presence_cb(host_address, conn_type,PRESENCE_LIGHT_RESOURCE_TYPE,presence_handler, NULL, &g_presence);
                        if (IOTCON_ERROR_NONE != nRet)
                        {
                                FPRINTF("[Line : %d][%s] iotcon_add_presence_cb failed: %s\\n", __LINE__, API_NAMESPACE,IotConGetError(nRet));
                                presence_main_loop_quit(false);
-                               return;
+                               return false;
                        }
                        nRet = iotcon_presence_get_connectivity_type(g_presence, &presence_conn_type);
                        if (IOTCON_ERROR_NONE != nRet)
@@ -223,18 +223,18 @@ static void presence_found_resource(iotcon_remote_resource_h resource,
                                FPRINTF("[Line : %d][%s] iotcon_presence_get_connectivity_type failed: %s\\n", __LINE__, API_NAMESPACE,IotConGetError(nRet));
                                iotcon_remove_presence_cb(g_presence);
                                presence_main_loop_quit(false);
-                               return;
+                               return false;
                        }
                        iotcon_remove_presence_cb(g_presence);
                        presence_main_loop_quit(true);
-                       return;
+                       return true;
                case PRESENCE_GET_RSRC_TYPE_P:
                        nRet = iotcon_add_presence_cb(host_address, conn_type,PRESENCE_LIGHT_RESOURCE_TYPE,presence_handler, NULL, &g_presence);
                        if (IOTCON_ERROR_NONE != nRet)
                        {
                                FPRINTF("[Line : %d][%s] iotcon_add_presence_cb failed: %s\\n", __LINE__, API_NAMESPACE,IotConGetError(nRet));
                                presence_main_loop_quit(false);
-                               return;
+                               return false;
                        }
                        nRet = iotcon_presence_get_resource_type(g_presence, &presence_resource_type);
                        if (IOTCON_ERROR_NONE != nRet)
@@ -242,15 +242,16 @@ static void presence_found_resource(iotcon_remote_resource_h resource,
                                FPRINTF("[Line : %d][%s] iotcon_presence_get_resource_type failed: %s\\n", __LINE__, API_NAMESPACE,IotConGetError(nRet));
                                iotcon_remove_presence_cb(g_presence);
                                presence_main_loop_quit(false);
-                               return;
+                               return false;
                        }
                        iotcon_remove_presence_cb(g_presence);
                        presence_main_loop_quit(true);
-                       return;
+                       return true;
                default:
                    FPRINTF("[Line : %d][%s] invalid index %d\\n", __LINE__, API_NAMESPACE,tc_index);
-                       return;
+                       return false;
        }
+       return false;
 }
 static int CreateAndFindResource(int tc_index)
 {
index 82beec4..2446cc6 100755 (executable)
@@ -192,9 +192,9 @@ static void IotconCachingChangedCB(iotcon_remote_resource_h resource, iotcon_rep
 * @parameter[IN]       iotcon_remote_resource_h resource
 * @parameter[IN]       iotcon_error_e err
 * @parameter[IN]       user_data The user data to pass to the function
-* @return                      void
+* @return                      bool
 */
-static void IotcoRemoteResourceMonitoringCB(iotcon_remote_resource_h resource, iotcon_error_e err, void *user_data)
+static bool IotcoRemoteResourceMonitoringCB(iotcon_remote_resource_h resource, iotcon_error_e err, void *user_data)
 {
        FPRINTF("[Line : %d][%s] IotcoRemoteResourceMonitoringCB\\n", __LINE__, API_NAMESPACE);
        int nIotconTimeoutId = 0;
@@ -214,9 +214,9 @@ static void IotcoRemoteResourceMonitoringCB(iotcon_remote_resource_h resource, i
                                g_main_loop_unref(g_pMainLoop);
                                g_pMainLoop = NULL;
                        }
-                       return;
+                       
                }
-               return;
+               return false;
        }
        else if (IOTCON_ERROR_NONE != err)
        {
@@ -226,11 +226,11 @@ static void IotcoRemoteResourceMonitoringCB(iotcon_remote_resource_h resource, i
                        g_main_loop_unref(g_pMainLoop);
                        g_pMainLoop = NULL;
                }
-               return;
+               return false;
        }
 
        if (g_found)
-               return;
+               return false;
 
        g_found = true;
 
@@ -251,7 +251,7 @@ static void IotcoRemoteResourceMonitoringCB(iotcon_remote_resource_h resource, i
                g_main_loop_quit(g_pMainLoop);
                g_main_loop_unref(g_pMainLoop);
                g_pMainLoop = NULL;
-               return;
+               return false;
        }
        g_nCheckAPICb = iotcon_remote_resource_start_monitoring(g_hcacheHandle, IotconMonitoringChangedCB,NULL);
        iotcon_resource_destroy(g_light_resource);
@@ -264,7 +264,7 @@ static void IotcoRemoteResourceMonitoringCB(iotcon_remote_resource_h resource, i
                g_main_loop_quit(g_pMainLoop);
                g_main_loop_unref(g_pMainLoop);
                g_pMainLoop = NULL;
-               return;
+               return false;
        }
        g_nCheckAPICb = iotcon_remote_resource_stop_monitoring(g_hcacheHandle);
        if (IOTCON_ERROR_NONE != g_nCheckAPICb)
@@ -273,7 +273,7 @@ static void IotcoRemoteResourceMonitoringCB(iotcon_remote_resource_h resource, i
                g_main_loop_quit(g_pMainLoop);
                g_main_loop_unref(g_pMainLoop);
                g_pMainLoop = NULL;
-               return;
+               return false;
        }
        iotcon_remote_resource_destroy(g_hcacheHandle);
 
@@ -283,7 +283,7 @@ static void IotcoRemoteResourceMonitoringCB(iotcon_remote_resource_h resource, i
                g_main_loop_unref(g_pMainLoop);
                g_pMainLoop = NULL;
        }
-       return;
+       return true;
 }
 
 /**
@@ -292,9 +292,9 @@ static void IotcoRemoteResourceMonitoringCB(iotcon_remote_resource_h resource, i
 * @parameter[IN]       iotcon_remote_resource_h resource
 * @parameter[IN]       iotcon_error_e err
 * @parameter[IN]       user_data The user data to pass to the function
-* @return                      void
+* @return                      bool
 */
-static void IotconRemoteResourceCachingCB(iotcon_remote_resource_h resource,iotcon_error_e err, void *user_data)
+static bool IotconRemoteResourceCachingCB(iotcon_remote_resource_h resource,iotcon_error_e err, void *user_data)
 {
        FPRINTF("[Line : %d][%s] IotconRemoteResourceCachingCB\\n", __LINE__, API_NAMESPACE);
        int nIotconTimeoutId = 0;
@@ -314,9 +314,9 @@ static void IotconRemoteResourceCachingCB(iotcon_remote_resource_h resource,iotc
                                g_main_loop_unref(g_pMainLoop);
                                g_pMainLoop = NULL;
                        }
-                       return;
+                       
                }
-               return;
+               return false;
        }
        else if (IOTCON_ERROR_NONE != err)
        {
@@ -326,11 +326,11 @@ static void IotconRemoteResourceCachingCB(iotcon_remote_resource_h resource,iotc
                        g_main_loop_unref(g_pMainLoop);
                        g_pMainLoop = NULL;
                }
-               return;
+               return false;
        }
 
        if (g_found)
-               return;
+               return false;
 
        g_found = true;
 
@@ -351,7 +351,7 @@ static void IotconRemoteResourceCachingCB(iotcon_remote_resource_h resource,iotc
                g_main_loop_quit(g_pMainLoop);
                g_main_loop_unref(g_pMainLoop);
                g_pMainLoop = NULL;
-               return;
+               return false;
        }
        g_nCheckAPICb = iotcon_remote_resource_start_caching(g_hcacheHandle, IotconCachingChangedCB, NULL);
        if (IOTCON_ERROR_NONE != g_nCheckAPICb)
@@ -361,7 +361,7 @@ static void IotconRemoteResourceCachingCB(iotcon_remote_resource_h resource,iotc
                g_main_loop_quit(g_pMainLoop);
                g_main_loop_unref(g_pMainLoop);
                g_pMainLoop = NULL;
-               return;
+               return false;
        }
        Iotcon_update_lite_resource();
        RUN_POLLING_LOOP;
@@ -374,7 +374,7 @@ static void IotconRemoteResourceCachingCB(iotcon_remote_resource_h resource,iotc
                g_main_loop_unref(g_pMainLoop);
                g_pMainLoop = NULL;
        }
-       return;
+       return true;
 }
 
 /**
@@ -383,9 +383,9 @@ static void IotconRemoteResourceCachingCB(iotcon_remote_resource_h resource,iotc
 * @parameter[IN]       iotcon_remote_resource_h resource
 * @parameter[IN]       iotcon_error_e err
 * @parameter[IN]       user_data The user data to pass to the function
-* @return                      void
+* @return                      bool
 */
-static void IotconRemoteResourceRepresentationCB(iotcon_remote_resource_h resource, iotcon_error_e err, void *user_data)
+static bool IotconRemoteResourceRepresentationCB(iotcon_remote_resource_h resource, iotcon_error_e err, void *user_data)
 {
        FPRINTF("[Line : %d][%s] IotconRemoteResourceRepresentationCB\\n", __LINE__, API_NAMESPACE);
        g_bCheckCb = true;
@@ -405,9 +405,9 @@ static void IotconRemoteResourceRepresentationCB(iotcon_remote_resource_h resour
                                g_main_loop_unref(g_pMainLoop);
                                g_pMainLoop = NULL;
                        }
-                       return;
+                       
                }
-               return;
+               return false;
        }
        else if (IOTCON_ERROR_NONE != err)
        {
@@ -417,11 +417,11 @@ static void IotconRemoteResourceRepresentationCB(iotcon_remote_resource_h resour
                        g_main_loop_unref(g_pMainLoop);
                        g_pMainLoop = NULL;
                }
-               return;
+               return false;
        }
 
        if (g_found)
-               return;
+               return false;
 
        g_found = true;
 
@@ -443,7 +443,7 @@ static void IotconRemoteResourceRepresentationCB(iotcon_remote_resource_h resour
                g_main_loop_quit(g_pMainLoop);
                g_main_loop_unref(g_pMainLoop);
                g_pMainLoop = NULL;
-               return;
+               return false;
        }
        g_nCheckAPICb = iotcon_remote_resource_start_caching(g_hcacheHandle, IotconRepresentationChangedCB, NULL);
        if (IOTCON_ERROR_NONE != g_nCheckAPICb)
@@ -453,7 +453,7 @@ static void IotconRemoteResourceRepresentationCB(iotcon_remote_resource_h resour
                g_main_loop_quit(g_pMainLoop);
                g_main_loop_unref(g_pMainLoop);
                g_pMainLoop = NULL;
-               return;
+               return false;
        }
        Iotcon_update_lite_resource();
        RUN_POLLING_LOOP;
@@ -466,16 +466,16 @@ static void IotconRemoteResourceRepresentationCB(iotcon_remote_resource_h resour
                g_main_loop_unref(g_pMainLoop);
                g_pMainLoop = NULL;
        }
-       return;
+       return true;
 }
 
 /**
 * @function            IotconRemoteResourceOptionsCB
 * @description         Callback Function
 * @parameter           iotcon_remote_resource_h resource, iotcon_error_e result,void *user_data
-* @return                      NA
+* @return                      bool
 */
- static void IotconRemoteResourceOptionsCB(iotcon_remote_resource_h resource, iotcon_error_e result,void *user_data)
+ static bool IotconRemoteResourceOptionsCB(iotcon_remote_resource_h resource, iotcon_error_e result,void *user_data)
 {
        FPRINTF("[Line : %d][%s] IotconRemoteResourceOptionsCB\\n", __LINE__, API_NAMESPACE);
        int nRet;
@@ -494,9 +494,9 @@ static void IotconRemoteResourceRepresentationCB(iotcon_remote_resource_h resour
                                g_main_loop_unref(g_pMainLoop);
                                g_pMainLoop = NULL;
                        }
-                       return;
+                       
                }
-               return;
+               return false;
        }
        else if (IOTCON_ERROR_NONE != result)
        {
@@ -506,11 +506,11 @@ static void IotconRemoteResourceRepresentationCB(iotcon_remote_resource_h resour
                        g_main_loop_unref(g_pMainLoop);
                        g_pMainLoop = NULL;
                }
-               return;
+               return false;
        }
 
        if (g_found)
-               return;
+               return false;
 
        g_found = true;
 
@@ -535,7 +535,7 @@ static void IotconRemoteResourceRepresentationCB(iotcon_remote_resource_h resour
                        g_main_loop_unref(g_pMainLoop);
                        g_pMainLoop = NULL;
                }
-               return;
+               return false;
        }
 
        if ( g_pMainLoop )
@@ -544,7 +544,7 @@ static void IotconRemoteResourceRepresentationCB(iotcon_remote_resource_h resour
                g_main_loop_unref(g_pMainLoop);
                g_pMainLoop = NULL;
        }
-       return;
+       return true;
 }
 
 /**
@@ -746,9 +746,9 @@ static void IotconDeleteChangedCB(iotcon_remote_resource_h resource, iotcon_erro
 * @parameter[IN]       iotcon_remote_resource_h resource
 * @parameter[IN]       iotcon_error_e err
 * @parameter[IN]       user_data The user data to pass to the function
-* @return                      void
+* @return                      bool
 */
-static void IotconRemoteResourceGetPutPostDelCB(iotcon_remote_resource_h resource, iotcon_error_e err, void *user_data)
+static bool IotconRemoteResourceGetPutPostDelCB(iotcon_remote_resource_h resource, iotcon_error_e err, void *user_data)
 {
        iotcon_query_h query;
        g_bCheckCb = true;
@@ -769,9 +769,9 @@ static void IotconRemoteResourceGetPutPostDelCB(iotcon_remote_resource_h resourc
                                g_main_loop_unref(g_pMainLoop);
                                g_pMainLoop = NULL;
                        }
-                       return;
+               
                }
-               return;
+               return false;
        }
        else if (IOTCON_ERROR_NONE != err)
        {
@@ -781,11 +781,11 @@ static void IotconRemoteResourceGetPutPostDelCB(iotcon_remote_resource_h resourc
                        g_main_loop_unref(g_pMainLoop);
                        g_pMainLoop = NULL;
                }
-               return;
+               return false;
        }
 
        if (g_found)
-               return;
+               return false;
 
        g_found = true;
 
@@ -804,14 +804,14 @@ static void IotconRemoteResourceGetPutPostDelCB(iotcon_remote_resource_h resourc
        if (IOTCON_ERROR_NONE != g_nCheckAPICb)
        {
                FPRINTF("[Line : %d][%s] iotcon_remote_resource_clone : %s\\n", __LINE__, API_NAMESPACE,IotConGetError(g_nCheckAPICb));
-               return;
+               return false;
        }
        g_nCheckAPICb = iotcon_query_create(&query);
        if (IOTCON_ERROR_NONE != g_nCheckAPICb)
        {
                FPRINTF("[Line : %d][%s] iotcon_query_create : %s\\n", __LINE__, API_NAMESPACE,IotConGetError(g_nCheckAPICb));
                iotcon_remote_resource_destroy(g_hcacheHandle);
-               return;
+               return false;
        }
        g_nCheckAPICb = iotcon_query_add(query, "key", "value");
        if (IOTCON_ERROR_NONE != g_nCheckAPICb)
@@ -819,7 +819,7 @@ static void IotconRemoteResourceGetPutPostDelCB(iotcon_remote_resource_h resourc
                FPRINTF("[Line : %d][%s] iotcon_query_add : %s\\n", __LINE__, API_NAMESPACE,IotConGetError(g_nCheckAPICb));
                iotcon_query_destroy(query);
                iotcon_remote_resource_destroy(g_hcacheHandle);
-               return;
+               return false;
        }
        //Get
        g_nCheckAPICb =  iotcon_remote_resource_get(g_hcacheHandle, query, IotconGetChangedCB, NULL);
@@ -828,7 +828,7 @@ static void IotconRemoteResourceGetPutPostDelCB(iotcon_remote_resource_h resourc
                FPRINTF("[Line : %d][%s] iotcon_remote_resource_get : %s\\n", __LINE__, API_NAMESPACE,IotConGetError(g_nCheckAPICb));
                iotcon_remote_resource_destroy(g_hcacheHandle);
                iotcon_query_destroy(query);
-               return;
+               return false;
        }
        RUN_POLLING_LOOP;
        iotcon_query_destroy(query);
@@ -838,13 +838,13 @@ static void IotconRemoteResourceGetPutPostDelCB(iotcon_remote_resource_h resourc
        {
                FPRINTF("[Line : %d][%s] iotcon_representation_create : %s\\n", __LINE__, API_NAMESPACE,IotConGetError(g_nCheckAPICb));
                iotcon_remote_resource_destroy(g_hcacheHandle);
-               return;
+               return false;
        }
        if(hRepr == NULL)
        {
                FPRINTF("[Line : %d][%s] iotcon_representation_create failed returned resource is NULL \\n", __LINE__, API_NAMESPACE);
                iotcon_remote_resource_destroy(g_hcacheHandle);
-               return;
+               return false;
        }
        g_nCheckAPICb = iotcon_remote_resource_put(g_hcacheHandle, hRepr, NULL, IotconPutChangedCB, NULL);
        if (IOTCON_ERROR_NONE != g_nCheckAPICb)
@@ -852,7 +852,7 @@ static void IotconRemoteResourceGetPutPostDelCB(iotcon_remote_resource_h resourc
                FPRINTF("[Line : %d][%s] iotcon_remote_resource_get : %s\\n", __LINE__, API_NAMESPACE,IotConGetError(g_nCheckAPICb));
                iotcon_remote_resource_destroy(g_hcacheHandle);
                iotcon_representation_destroy(hRepr);
-               return;
+               return false;
        }
        RUN_POLLING_LOOP;
        //post
@@ -862,7 +862,7 @@ static void IotconRemoteResourceGetPutPostDelCB(iotcon_remote_resource_h resourc
                FPRINTF("[Line : %d][%s] iotcon_remote_resource_get : %s\\n", __LINE__, API_NAMESPACE,IotConGetError(g_nCheckAPICb));
                iotcon_remote_resource_destroy(g_hcacheHandle);
                iotcon_representation_destroy(hRepr);
-               return;
+               return false;
        }
        RUN_POLLING_LOOP;
        iotcon_representation_destroy(hRepr);
@@ -872,7 +872,7 @@ static void IotconRemoteResourceGetPutPostDelCB(iotcon_remote_resource_h resourc
        {
                FPRINTF("[Line : %d][%s] iotcon_remote_resource_get : %s\\n", __LINE__, API_NAMESPACE,IotConGetError(g_nCheckAPICb));
                iotcon_remote_resource_destroy(g_hcacheHandle);
-               return;
+               return false;
        }
        RUN_POLLING_LOOP;
        iotcon_remote_resource_destroy(g_hcacheHandle);
@@ -882,7 +882,7 @@ static void IotconRemoteResourceGetPutPostDelCB(iotcon_remote_resource_h resourc
                g_main_loop_unref(g_pMainLoop);
                g_pMainLoop = NULL;
        }
-       return;
+       return true;
 }
 
 /**
@@ -927,9 +927,9 @@ static void IotconObserveChangedCB(iotcon_remote_resource_h resource, iotcon_err
 * @parameter[IN]       iotcon_remote_resource_h resource
 * @parameter[IN]       iotcon_error_e err
 * @parameter[IN]       user_data The user data to pass to the function
-* @return                      void
+* @return                      bool
 */
-static void IotconRemoteResourceObserveCB(iotcon_remote_resource_h resource, iotcon_error_e err, void *user_data)
+static bool IotconRemoteResourceObserveCB(iotcon_remote_resource_h resource, iotcon_error_e err, void *user_data)
 {
        FPRINTF("[Line : %d][%s] IotconRemoteResourceObserveCB\\n", __LINE__, API_NAMESPACE);
        int nIotconTimeoutId = 0;
@@ -950,9 +950,9 @@ static void IotconRemoteResourceObserveCB(iotcon_remote_resource_h resource, iot
                                g_main_loop_unref(g_pMainLoop);
                                g_pMainLoop = NULL;
                        }
-                       return;
+                       
                }
-               return;
+               return false;
        }
        else if (IOTCON_ERROR_NONE != err)
        {
@@ -963,11 +963,11 @@ static void IotconRemoteResourceObserveCB(iotcon_remote_resource_h resource, iot
                        g_main_loop_unref(g_pMainLoop);
                        g_pMainLoop = NULL;
                }
-               return;
+               return false;
        }
 
        if (g_found)
-               return;
+               return false;
 
        g_found = true;
 
@@ -985,14 +985,14 @@ static void IotconRemoteResourceObserveCB(iotcon_remote_resource_h resource, iot
        if (IOTCON_ERROR_NONE != g_nCheckAPICb)
        {
                FPRINTF("[Line : %d][%s] iotcon_remote_resource_clone : %s\\n", __LINE__, API_NAMESPACE,IotConGetError(g_nCheckAPICb));
-               return;
+               return false;
        }
        g_nCheckAPICb = iotcon_remote_resource_observe_register(g_hcacheHandle, IOTCON_OBSERVE_IGNORE_OUT_OF_ORDER, NULL, IotconObserveChangedCB, NULL);
        if (IOTCON_ERROR_NONE != g_nCheckAPICb)
        {
                FPRINTF("[Line : %d][%s] iotcon_remote_resource_observe_register : %s\\n", __LINE__, API_NAMESPACE,IotConGetError(g_nCheckAPICb));
                iotcon_remote_resource_destroy(g_hcacheHandle);
-               return;
+               return false;
        }
        RUN_POLLING_LOOP;
 
@@ -1003,7 +1003,7 @@ static void IotconRemoteResourceObserveCB(iotcon_remote_resource_h resource, iot
                g_main_loop_unref(g_pMainLoop);
                g_pMainLoop = NULL;
        }
-       return;
+       return true;
 }
 /**
  * @function           ITs_iotcon_remote_resource_startup
@@ -1625,16 +1625,16 @@ int ITc_iotcon_remote_resource_get_interfaces_p(void)
 //& purpose: Creates a new query handle.
 //& type: auto
 /**
-* @testcase                    ITc_iotcon_remote_resource_get_policies_p
+* @testcase                    ITc_iotcon_remote_resource_get_properties_p
 * @since_tizen                 3.0
 * @author              SRID(asit.s)
 * @reviewer            SRID(parshant.v)
 * @type                                auto
 * @description                 Creates a new query handle.
-* @scenario                            call iotcon_remote_resource_get_policies
-* @apicovered                  iotcon_remote_resource_get_policies
-* @passcase                            When iotcon_remote_resource_get_policies is successful.
-* @failcase                            If target API iotcon_remote_resource_get_policies or any precondition API fails.
+* @scenario                            call iotcon_remote_resource_get_properties
+* @apicovered                  iotcon_remote_resource_get_properties
+* @passcase                            When iotcon_remote_resource_get_properties is successful.
+* @failcase                            If target API iotcon_remote_resource_get_properties or any precondition API fails.
 * @precondition                        NA
 * @postcondition               NA
 */
@@ -1740,8 +1740,8 @@ int ITc_iotcon_remote_resource_set_get_options_p(void)
 * @type                                auto
 * @description                 Creates a new query handle.
 * @scenario                            call iotcon_query_create
-* @apicovered                  iotcon_remote_resource_clone,iotcon_remote_resource_start_caching,iotcon_remote_resource_get_cached_representation
-* @passcase                            When iotcon_remote_resource_clone,iotcon_remote_resource_start_caching,iotcon_remote_resource_get_cached_representation are successful.
+* @apicovered                  iotcon_remote_resource_clone,iotcon_remote_resource_start_caching,      iotcon_state_create,iotcon_state_add_int,iotcon_lite_resource_update_state,iotcon_remote_resource_get_cached_representation
+* @passcase                            When iotcon_remote_resource_clone,iotcon_remote_resource_start_caching, iotcon_state_create,iotcon_state_add_int,iotcon_lite_resource_update_state,iotcon_remote_resource_get_cached_representation     are successful.
 * @failcase                            If target API or any precondition API fails.
 * @precondition                        NA
 * @postcondition               NA
index 786265d..f6f4c8d 100755 (executable)
@@ -715,10 +715,9 @@ static void ResourceObserveCB(iotcon_remote_resource_h resource,
 * @description         get remote resource clone
 * @parameter           iotcon_remote_resource_h : The remote resource handle, iotcon_error_e : iotcon error
 *                                      user_data : The user data passed from function
-* @return                      NA
+* @return                      bool
 */
-static void FoundResourceCB(iotcon_remote_resource_h resource,
-               iotcon_error_e err, void *user_data)
+static bool FoundResourceCB(iotcon_remote_resource_h resource,iotcon_error_e err, void *user_data)
 {
        FPRINTF("Inside FoundResourceCB callback... \n");
 
@@ -733,12 +732,12 @@ static void FoundResourceCB(iotcon_remote_resource_h resource,
                if (IOTCON_ERROR_NONE != nRet) {
                        FPRINTF("iotcon_find_resource() Fail(%d)", nRet);
                        QuitGmainLoopIdle(false);
-                       return;
+                       
                }
-               return;
+               return false;
        } else if (IOTCON_ERROR_NONE != err) {
                QuitGmainLoopIdle(false);
-               return;
+               return false;
        }
 
        char *host_address, *uri;
@@ -753,14 +752,14 @@ static void FoundResourceCB(iotcon_remote_resource_h resource,
                if (IOTCON_ERROR_NONE != nRet) {
                        FPRINTF("iotcon_resource_set_request_handler() Fail(%d)", nRet);
                        QuitGmainLoopIdle(false);
-                       return;
+                       return false;
                }
 
                nRet = iotcon_remote_resource_clone(resource, &g_hRemoteResource);
                if (IOTCON_ERROR_NONE != nRet) {
                        FPRINTF("iotcon_remote_resource_clone() Fail(%d)", nRet);
                        QuitGmainLoopIdle(false);
-                       return;
+                       return false;
                }
 
                nRet = iotcon_remote_resource_observe_register(g_hRemoteResource,
@@ -768,7 +767,7 @@ static void FoundResourceCB(iotcon_remote_resource_h resource,
                if (IOTCON_ERROR_NONE != nRet) {
                        FPRINTF("iotcon_remote_resource_observe_register() Fail(%d)", nRet);
                        QuitGmainLoopIdle(false);
-                       return;
+                       return false;
                }
                break;
        case RESOURCE_CREATE:
@@ -777,7 +776,7 @@ static void FoundResourceCB(iotcon_remote_resource_h resource,
                if (IOTCON_ERROR_NONE != nRet) {
                        FPRINTF("iotcon_remote_resource_clone() Fail(%d)", nRet);
                        QuitGmainLoopIdle(false);
-                       return;
+                       return false;
                }
 
                nRet = iotcon_remote_resource_observe_register(g_hRemoteResource,
@@ -785,14 +784,16 @@ static void FoundResourceCB(iotcon_remote_resource_h resource,
                if (IOTCON_ERROR_NONE != nRet) {
                        FPRINTF("iotcon_remote_resource_observe_register() Fail(%d)", nRet);
                        QuitGmainLoopIdle(false);
-                       return;
+                       return false;
                }
                break;
        default:
                FPRINTF("Invalid tc_index(%d)", tc_index);
                QuitGmainLoopIdle(false);
-               return;
+               return false;
        }
+       
+       return true;
 }
 
 /**