}
return 0;
}
+//& purpose: CrGets the device name.
+//& type: auto
+/**
+* @testcase ITc_remote_resource_get_device_name_p
+* @since_tizen 3.0
+* @author SRID(shilpa.j)
+* @reviewer SRID(a.pandia1)
+* @type auto
+* @description Gets the device name API of remote resource.
+* @scenario call iotcon_remote_resource_get_device_name
+* @apicovered iotcon_remote_resource_get_device_name,iotcon_remote_resource_destroy
+* @passcase When iotcon_remote_resource_get_device_name is successful.
+* @failcase If target API or any precondition API fails.
+* @precondition NA
+* @postcondition NA
+*/
+int ITc_remote_resource_get_device_name_p(void)
+{
+
+ char *pszDeviceName =NULL;
+ int nIotconTimeoutId = 0;
+
+ g_bCheckCb = false;
+
+ int nRet = IotconCreateLiteResource();
+ if (IOTCON_ERROR_NONE != nRet)
+ {
+ FPRINTF("[Line : %d][%s] IotconCreateLiteResource failed : %s\\n", __LINE__, API_NAMESPACE,IotConGetError(nRet));
+ return 1;
+ }
+ nRet = iotcon_find_resource(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4,ENCAP_LIGHT_RESOURCE_TYPE, false, IotconRemoteResourceOptionsCB, NULL);
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_find_resource", IotConGetError(nRet), IotconDestroyLiteResource());
+ RUN_POLLING_LOOP;
+
+ if(g_bCheckCb == false)
+ {
+ FPRINTF("[Line : %d][%s] IotconRemoteResourceOptionsCB callback not invoked: \\n", __LINE__, API_NAMESPACE );
+ IotconDestroyLiteResource();
+ return 1;
+ }
+
+
+ nRet = iotcon_remote_resource_get_device_name(g_hResourceHandle, &pszDeviceName);
+ PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_remote_resource_get_device_name", IotConGetError(nRet), IotconDestroyLiteResource();iotcon_remote_resource_destroy(g_hResourceHandle));
+ if(pszDeviceName == NULL)
+ {
+ FPRINTF("[Line : %d][%s] iotcon_remote_resource_get_device_name failed : %s\\n", __LINE__, API_NAMESPACE,IotConGetError(nRet));
+ iotcon_remote_resource_destroy(g_hResourceHandle);
+ IotconDestroyLiteResource();
+ return 1;
+
+ }
+ iotcon_remote_resource_destroy(g_hResourceHandle);
+ IotconDestroyLiteResource();
+
+
+ return 0;
+}
+
+
+
/** @} */
/** @} */
return 0;
}
+//& type: auto
+//& purpose: set the device name
+/**
+* @testcase ITc_iotcon_set_get_polling_interval_p
+* @author SRID(shilpa.j)
+* @reviewer SRID(a.pandia1)
+* @type auto
+* @since_tizen 3.0
+* @description sets the device name
+* @scenario sets the device name *
+* @apicovered iotcon_set_device_name
+* @passcase if iotcon_set_device_name passes
+* @failcase if iotcon_set_device_name fails
+* @precondition NA
+* @postcondition NA
+*/
+int ITc_iotcon_set_device_name_p(void)
+{
+ START_TEST;
+ char*pszDeviceName = "device_name";
+ int nRet = iotcon_set_device_name(pszDeviceName);
+ PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_set_device_name", IotConGetError(nRet));
+
+ return 0;
+}
+
#if 0
//& type: auto
extern int ITc_iotcon_attributes_get_keys_count_p(void);
extern int ITc_iotcon_attributes_add_get_byte_str_p(void);
//extern int ITc_iotcon_set_persistent_storage_p(void);
+extern int ITc_iotcon_set_device_name_p(void);
+extern int ITc_remote_resource_get_device_name_p(void);
{"ITc_iotcon_attributes_foreach_p", ITc_iotcon_attributes_foreach_p, ITs_iotcon_attributes_startup, ITs_iotcon_attributes_cleanup},
{"ITc_iotcon_attributes_get_keys_count_p", ITc_iotcon_attributes_get_keys_count_p, ITs_iotcon_attributes_startup, ITs_iotcon_attributes_cleanup},
{"ITc_iotcon_attributes_add_get_byte_str_p", ITc_iotcon_attributes_add_get_byte_str_p, ITs_iotcon_attributes_startup, ITs_iotcon_attributes_cleanup},
+ {"ITc_iotcon_set_device_name_p", ITc_iotcon_set_device_name_p, ITs_iotcon_startup, ITs_iotcon_cleanup},
+ {"ITc_remote_resource_get_device_name_p", ITc_remote_resource_get_device_name_p, ITs_iotcon_remote_resource_startup, ITs_iotcon_remote_resource_cleanup},
// {"ITc_iotcon_set_persistent_storage_p", ITc_iotcon_set_persistent_storage_p, ITs_iotcon_security_startup, ITs_iotcon_security_cleanup},
{NULL, NULL}
};
extern int ITc_iotcon_attributes_get_keys_count_p(void);
extern int ITc_iotcon_attributes_add_get_byte_str_p(void);
//extern int ITc_iotcon_set_persistent_storage_p(void);
+extern int ITc_iotcon_set_device_name_p(void);
+extern int ITc_remote_resource_get_device_name_p(void);
{"ITc_iotcon_attributes_foreach_p", ITc_iotcon_attributes_foreach_p, ITs_iotcon_attributes_startup, ITs_iotcon_attributes_cleanup},
{"ITc_iotcon_attributes_get_keys_count_p", ITc_iotcon_attributes_get_keys_count_p, ITs_iotcon_attributes_startup, ITs_iotcon_attributes_cleanup},
{"ITc_iotcon_attributes_add_get_byte_str_p", ITc_iotcon_attributes_add_get_byte_str_p, ITs_iotcon_attributes_startup, ITs_iotcon_attributes_cleanup},
+ {"ITc_iotcon_set_device_name_p", ITc_iotcon_set_device_name_p, ITs_iotcon_startup, ITs_iotcon_cleanup},
+ {"ITc_remote_resource_get_device_name_p", ITc_remote_resource_get_device_name_p, ITs_iotcon_remote_resource_startup, ITs_iotcon_remote_resource_cleanup},
// {"ITc_iotcon_set_persistent_storage_p", ITc_iotcon_set_persistent_storage_p, ITs_iotcon_security_startup, ITs_iotcon_security_cleanup},
{NULL, NULL}
};
extern int ITc_iotcon_attributes_get_keys_count_p(void);
extern int ITc_iotcon_attributes_add_get_byte_str_p(void);
//extern int ITc_iotcon_set_persistent_storage_p(void);
+extern int ITc_iotcon_set_device_name_p(void);
+extern int ITc_remote_resource_get_device_name_p(void);
{"ITc_iotcon_attributes_foreach_p", ITc_iotcon_attributes_foreach_p, ITs_iotcon_attributes_startup, ITs_iotcon_attributes_cleanup},
{"ITc_iotcon_attributes_get_keys_count_p", ITc_iotcon_attributes_get_keys_count_p, ITs_iotcon_attributes_startup, ITs_iotcon_attributes_cleanup},
{"ITc_iotcon_attributes_add_get_byte_str_p", ITc_iotcon_attributes_add_get_byte_str_p, ITs_iotcon_attributes_startup, ITs_iotcon_attributes_cleanup},
+ {"ITc_iotcon_set_device_name_p", ITc_iotcon_set_device_name_p, ITs_iotcon_startup, ITs_iotcon_cleanup},
+ {"ITc_remote_resource_get_device_name_p", ITc_remote_resource_get_device_name_p, ITs_iotcon_remote_resource_startup, ITs_iotcon_remote_resource_cleanup},
// {"ITc_iotcon_set_persistent_storage_p", ITc_iotcon_set_persistent_storage_p, ITs_iotcon_security_startup, ITs_iotcon_security_cleanup},
{NULL, NULL}
};
extern int ITc_iotcon_attributes_get_keys_count_p(void);
extern int ITc_iotcon_attributes_add_get_byte_str_p(void);
//extern int ITc_iotcon_set_persistent_storage_p(void);
+extern int ITc_iotcon_set_device_name_p(void);
+extern int ITc_remote_resource_get_device_name_p(void);
{"ITc_iotcon_attributes_foreach_p", ITc_iotcon_attributes_foreach_p, ITs_iotcon_attributes_startup, ITs_iotcon_attributes_cleanup},
{"ITc_iotcon_attributes_get_keys_count_p", ITc_iotcon_attributes_get_keys_count_p, ITs_iotcon_attributes_startup, ITs_iotcon_attributes_cleanup},
{"ITc_iotcon_attributes_add_get_byte_str_p", ITc_iotcon_attributes_add_get_byte_str_p, ITs_iotcon_attributes_startup, ITs_iotcon_attributes_cleanup},
+ {"ITc_iotcon_set_device_name_p", ITc_iotcon_set_device_name_p, ITs_iotcon_startup, ITs_iotcon_cleanup},
+ {"ITc_remote_resource_get_device_name_p", ITc_remote_resource_get_device_name_p, ITs_iotcon_remote_resource_startup, ITs_iotcon_remote_resource_cleanup},
// {"ITc_iotcon_set_persistent_storage_p", ITc_iotcon_set_persistent_storage_p, ITs_iotcon_security_startup, ITs_iotcon_security_cleanup},
{NULL, NULL}
};