#include "icl.h"
#include "icl-dbus.h"
-API int iotcon_open(void)
+API int iotcon_connect(void)
{
int ret;
}
-API void iotcon_close(void)
+API void iotcon_disconnect(void)
{
icl_dbus_stop();
}
*/
/**
- * @brief Opens Iotcon.
+ * @brief Connects to the iotcon service.
* @details Call this function to start Iotcon.
*
* @since_tizen 3.0
*
- * @remarks You must free all resources of the Iotcon by calling iotcon_close()
+ * @remarks You must free all resources of the Iotcon by calling iotcon_disconnect()
* if Iotcon API is no longer needed.
*
* @return 0 on success, otherwise a negative error value.
* @retval #IOTCON_ERROR_NONE Successful
* @retval #IOTCON_ERROR_DBUS Dbus error
*
- * @see iotcon_close()
+ * @see iotcon_disconnect()
*/
-int iotcon_open(void);
+int iotcon_connect(void);
/**
- * @brief Closes Iotcon.
+ * @brief Disconnects from the iotcon service.
* @details Frees the resources allocated to Iotcon.
*
* @since_tizen 3.0
*
* @return void
*
- * @see iotcon_open()
+ * @see iotcon_connect()
*/
-void iotcon_close(void);
+void iotcon_disconnect(void);
/**
* @brief Gets timeout of asynchronous APIs.
* @retval #IOTCON_ERROR_NONE Successful
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
*
- * @pre iotcon_open() should be called to open a connection to the iotcon.
+ * @pre iotcon_connect() should be called to connect a connection to the iotcon.
*
* @see iotcon_get_device_info()
* @see iotcon_get_platform_info()
* @retval #IOTCON_ERROR_NONE Successful
* @retval #IOTCON_ERROR_DBUS Dbus error
*
- * @pre iotcon_open() should be called to open a connection to the iotcon.
+ * @pre iotcon_connect() should be called to connect a connection to the iotcon.
*
* @see iotcon_request_device_info()
* @see iotcon_request_platform_info()
loop = g_main_loop_new(NULL, FALSE);
- /* iotcon open */
- ret = iotcon_open();
+ /* connect iotcon */
+ ret = iotcon_connect();
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_open() Fail(%d)", ret);
+ ERR("iotcon_connect() Fail(%d)", ret);
return -1;
}
"core.door", &_found_resource, NULL);
if (IOTCON_ERROR_NONE != ret) {
ERR("iotcon_find_resource() Fail(%d)", ret);
- iotcon_close();
+ iotcon_disconnect();
return -1;
}
g_list_free_full(device_id_list, free);
- /* iotcon close */
- iotcon_close();
+ /* disconnect iotcon */
+ iotcon_disconnect();
return 0;
}
loop = g_main_loop_new(NULL, FALSE);
- /* iotcon open */
- ret = iotcon_open();
+ /* connect iotcon */
+ ret = iotcon_connect();
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_open() Fail(%d)", ret);
+ ERR("iotcon_connect() Fail(%d)", ret);
return -1;
}
ret = _set_door_resource(&my_door);
if (0 != ret) {
ERR("_set_door_resource() Fail");
- iotcon_close();
+ iotcon_disconnect();
return -1;
}
if (NULL == my_door.handle) {
ERR("_create_door_resource() Fail");
_free_door_resource(&my_door);
- iotcon_close();
+ iotcon_disconnect();
return -1;
}
_free_door_resource(&my_door);
- /* iotcon close */
- iotcon_close();
+ /* disconnect iotcon */
+ iotcon_disconnect();
return 0;
}
loop = g_main_loop_new(NULL, FALSE);
- /* iotcon open */
- ret = iotcon_open();
+ /* connect iotcon */
+ ret = iotcon_connect();
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_open() Fail(%d)", ret);
+ ERR("iotcon_connect() Fail(%d)", ret);
return -1;
}
_request_device_info, NULL);
if (IOTCON_ERROR_NONE != ret) {
ERR("iotcon_request_device_info() Fail(%d)", ret);
- iotcon_close();
+ iotcon_disconnect();
return -1;
}
_request_platform_info, NULL);
if (IOTCON_ERROR_NONE != ret) {
ERR("iotcon_request_platform_info() Fail(%d)", ret);
- iotcon_close();
+ iotcon_disconnect();
return -1;
}
g_main_loop_unref(loop);
- /* iotcon close */
- iotcon_close();
+ /* disconnect iotcon */
+ iotcon_disconnect();
return 0;
}
loop = g_main_loop_new(NULL, FALSE);
- /* iotcon open */
- ret = iotcon_open();
+ /* connect iotcon */
+ ret = iotcon_connect();
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_open() Fail(%d)", ret);
+ ERR("iotcon_connect() Fail(%d)", ret);
return -1;
}
"core.door", &_found_resource, &resource);
if (IOTCON_ERROR_NONE != ret) {
ERR("iotcon_find_resource() Fail(%d)", ret);
- iotcon_close();
+ iotcon_disconnect();
return -1;
}
g_list_free_full(device_id_list, free);
- /* iotcon close */
- iotcon_close();
+ /* disconnect iotcon */
+ iotcon_disconnect();
return 0;
}
loop = g_main_loop_new(NULL, FALSE);
- /* iotcon open */
- ret = iotcon_open();
+ /* connect iotcon */
+ ret = iotcon_connect();
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_open() Fail(%d)", ret);
+ ERR("iotcon_connect() Fail(%d)", ret);
return -1;
}
ret = _set_door_resource(&my_door);
if (0 != ret) {
ERR("_set_door_resource() Fail");
- iotcon_close();
+ iotcon_disconnect();
return -1;
}
ERR("_create_door_resource() Fail");
_free_door_resource(&my_door);
iotcon_stop_presence();
- iotcon_close();
+ iotcon_disconnect();
return -1;
}
iotcon_stop_presence();
- /* iotcon close */
- iotcon_close();
+ /* disconnect iotcon */
+ iotcon_disconnect();
return 0;
}
loop = g_main_loop_new(NULL, FALSE);
- /* iotcon open */
- ret = iotcon_open();
+ /* connect iotcon */
+ ret = iotcon_connect();
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_open() Fail(%d)", ret);
+ ERR("iotcon_connect() Fail(%d)", ret);
return -1;
}
"core.room", &_found_resource, NULL);
if (IOTCON_ERROR_NONE != ret) {
ERR("iotcon_find_resource() Fail(%d)", ret);
- iotcon_close();
+ iotcon_disconnect();
return -1;
}
g_list_free_full(device_id_list, free);
- /* iotcon close */
- iotcon_close();
+ /* disconnect iotcon */
+ iotcon_disconnect();
return 0;
}
loop = g_main_loop_new(NULL, FALSE);
- /* iotcon open */
- ret = iotcon_open();
+ /* connect iotcon */
+ ret = iotcon_connect();
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_open() Fail(%d)", ret);
+ ERR("iotcon_connect() Fail(%d)", ret);
return -1;
}
ret = iotcon_resource_types_create(&room_rtypes);
if (IOTCON_ERROR_NONE != ret) {
ERR("iotcon_resource_types_create() Fail(%d)", ret);
- iotcon_close();
+ iotcon_disconnect();
return -1;
}
ret = iotcon_resource_types_add(room_rtypes, "core.room");
if (IOTCON_ERROR_NONE != ret) {
ERR("iotcon_resource_types_add(%s) Fail(%d)", "core.room", ret);
iotcon_resource_types_destroy(room_rtypes);
- iotcon_close();
+ iotcon_disconnect();
return -1;
}
if (IOTCON_ERROR_NONE != ret) {
ERR("iotcon_resource_create() Fail(%d)", ret);
iotcon_resource_types_destroy(room_rtypes);
- iotcon_close();
+ iotcon_disconnect();
return -1;
}
iotcon_resource_types_destroy(room_rtypes);
if (IOTCON_ERROR_NONE != ret) {
ERR("iotcon_resource_types_create() Fail(%d)", ret);
iotcon_resource_destroy(room_handle);
- iotcon_close();
+ iotcon_disconnect();
return -1;
}
ret = iotcon_resource_types_add(light_rtypes, "core.light");
ERR("iotcon_resource_types_add(%s) Fail(%d)", "core.light", ret);
iotcon_resource_types_destroy(light_rtypes);
iotcon_resource_destroy(room_handle);
- iotcon_close();
+ iotcon_disconnect();
return -1;
}
ERR("iotcon_resource_create() Fail");
iotcon_resource_types_destroy(light_rtypes);
iotcon_resource_destroy(room_handle);
- iotcon_close();
+ iotcon_disconnect();
return -1;
}
iotcon_resource_types_destroy(light_rtypes);
ERR("iotcon_resource_bind_child_resource() Fail");
iotcon_resource_destroy(light_handle);
iotcon_resource_destroy(room_handle);
- iotcon_close();
+ iotcon_disconnect();
return -1;
}
iotcon_resource_destroy(light_handle);
iotcon_resource_destroy(room_handle);
- /* iotcon close */
- iotcon_close();
+ /* disconnect iotcon */
+ iotcon_disconnect();
return 0;
}