From 827cc693889d28d325311ea860c00cd3303ee78d Mon Sep 17 00:00:00 2001 From: "sung.goo.kim" Date: Fri, 30 Oct 2015 16:07:25 +0900 Subject: [PATCH] (ACR) iotcon_open/close->connect/disconnect Change-Id: Ie10367f894f8853a3c8561c8e2f5dea2848b451b --- lib/icl.c | 4 ++-- lib/include/iotcon.h | 18 +++++++++--------- test/iotcon-test-basic-client.c | 12 ++++++------ test/iotcon-test-basic-server.c | 14 +++++++------- test/iotcon-test-device-client.c | 14 +++++++------- test/iotcon-test-encap-client.c | 12 ++++++------ test/iotcon-test-encap-server.c | 14 +++++++------- test/iotcon-test-repr-client.c | 12 ++++++------ test/iotcon-test-repr-server.c | 24 ++++++++++++------------ 9 files changed, 62 insertions(+), 62 deletions(-) diff --git a/lib/icl.c b/lib/icl.c index f946b60..33c2c50 100644 --- a/lib/icl.c +++ b/lib/icl.c @@ -19,7 +19,7 @@ #include "icl.h" #include "icl-dbus.h" -API int iotcon_open(void) +API int iotcon_connect(void) { int ret; @@ -35,7 +35,7 @@ API int iotcon_open(void) } -API void iotcon_close(void) +API void iotcon_disconnect(void) { icl_dbus_stop(); } diff --git a/lib/include/iotcon.h b/lib/include/iotcon.h index 1312591..8f3c2a4 100644 --- a/lib/include/iotcon.h +++ b/lib/include/iotcon.h @@ -40,24 +40,24 @@ extern "C" { */ /** - * @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 @@ -66,9 +66,9 @@ int iotcon_open(void); * * @return void * - * @see iotcon_open() + * @see iotcon_connect() */ -void iotcon_close(void); +void iotcon_disconnect(void); /** * @brief Gets timeout of asynchronous APIs. @@ -81,7 +81,7 @@ void iotcon_close(void); * @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() @@ -108,7 +108,7 @@ int iotcon_get_timeout(int *timeout_seconds); * @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() diff --git a/test/iotcon-test-basic-client.c b/test/iotcon-test-basic-client.c index d431def..c3e9e9e 100644 --- a/test/iotcon-test-basic-client.c +++ b/test/iotcon-test-basic-client.c @@ -450,10 +450,10 @@ int main(int argc, char **argv) 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; } @@ -462,7 +462,7 @@ int main(int argc, char **argv) "core.door", &_found_resource, NULL); if (IOTCON_ERROR_NONE != ret) { ERR("iotcon_find_resource() Fail(%d)", ret); - iotcon_close(); + iotcon_disconnect(); return -1; } @@ -471,8 +471,8 @@ int main(int argc, char **argv) g_list_free_full(device_id_list, free); - /* iotcon close */ - iotcon_close(); + /* disconnect iotcon */ + iotcon_disconnect(); return 0; } diff --git a/test/iotcon-test-basic-server.c b/test/iotcon-test-basic-server.c index ada1a25..7970b3a 100644 --- a/test/iotcon-test-basic-server.c +++ b/test/iotcon-test-basic-server.c @@ -529,10 +529,10 @@ int main(int argc, char **argv) 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; } @@ -540,7 +540,7 @@ int main(int argc, char **argv) ret = _set_door_resource(&my_door); if (0 != ret) { ERR("_set_door_resource() Fail"); - iotcon_close(); + iotcon_disconnect(); return -1; } @@ -557,7 +557,7 @@ int main(int argc, char **argv) if (NULL == my_door.handle) { ERR("_create_door_resource() Fail"); _free_door_resource(&my_door); - iotcon_close(); + iotcon_disconnect(); return -1; } @@ -570,8 +570,8 @@ int main(int argc, char **argv) _free_door_resource(&my_door); - /* iotcon close */ - iotcon_close(); + /* disconnect iotcon */ + iotcon_disconnect(); return 0; } diff --git a/test/iotcon-test-device-client.c b/test/iotcon-test-device-client.c index e5c1f44..8111b71 100644 --- a/test/iotcon-test-device-client.c +++ b/test/iotcon-test-device-client.c @@ -173,10 +173,10 @@ int main() 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; } @@ -184,7 +184,7 @@ int main() _request_device_info, NULL); if (IOTCON_ERROR_NONE != ret) { ERR("iotcon_request_device_info() Fail(%d)", ret); - iotcon_close(); + iotcon_disconnect(); return -1; } @@ -192,7 +192,7 @@ int main() _request_platform_info, NULL); if (IOTCON_ERROR_NONE != ret) { ERR("iotcon_request_platform_info() Fail(%d)", ret); - iotcon_close(); + iotcon_disconnect(); return -1; } @@ -200,8 +200,8 @@ int main() g_main_loop_unref(loop); - /* iotcon close */ - iotcon_close(); + /* disconnect iotcon */ + iotcon_disconnect(); return 0; } diff --git a/test/iotcon-test-encap-client.c b/test/iotcon-test-encap-client.c index 8351ece..2ab9667 100644 --- a/test/iotcon-test-encap-client.c +++ b/test/iotcon-test-encap-client.c @@ -223,10 +223,10 @@ int main(int argc, char **argv) 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; } @@ -235,7 +235,7 @@ int main(int argc, char **argv) "core.door", &_found_resource, &resource); if (IOTCON_ERROR_NONE != ret) { ERR("iotcon_find_resource() Fail(%d)", ret); - iotcon_close(); + iotcon_disconnect(); return -1; } @@ -244,8 +244,8 @@ int main(int argc, char **argv) g_list_free_full(device_id_list, free); - /* iotcon close */ - iotcon_close(); + /* disconnect iotcon */ + iotcon_disconnect(); return 0; } diff --git a/test/iotcon-test-encap-server.c b/test/iotcon-test-encap-server.c index e4c0f26..d89ee19 100644 --- a/test/iotcon-test-encap-server.c +++ b/test/iotcon-test-encap-server.c @@ -178,10 +178,10 @@ int main(int argc, char **argv) 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; } @@ -196,7 +196,7 @@ int main(int argc, char **argv) ret = _set_door_resource(&my_door); if (0 != ret) { ERR("_set_door_resource() Fail"); - iotcon_close(); + iotcon_disconnect(); return -1; } @@ -210,7 +210,7 @@ int main(int argc, char **argv) ERR("_create_door_resource() Fail"); _free_door_resource(&my_door); iotcon_stop_presence(); - iotcon_close(); + iotcon_disconnect(); return -1; } @@ -227,8 +227,8 @@ int main(int argc, char **argv) iotcon_stop_presence(); - /* iotcon close */ - iotcon_close(); + /* disconnect iotcon */ + iotcon_disconnect(); return 0; } diff --git a/test/iotcon-test-repr-client.c b/test/iotcon-test-repr-client.c index 849d4f7..1fa83cb 100644 --- a/test/iotcon-test-repr-client.c +++ b/test/iotcon-test-repr-client.c @@ -336,10 +336,10 @@ int main(int argc, char **argv) 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; } @@ -348,7 +348,7 @@ int main(int argc, char **argv) "core.room", &_found_resource, NULL); if (IOTCON_ERROR_NONE != ret) { ERR("iotcon_find_resource() Fail(%d)", ret); - iotcon_close(); + iotcon_disconnect(); return -1; } @@ -357,8 +357,8 @@ int main(int argc, char **argv) g_list_free_full(device_id_list, free); - /* iotcon close */ - iotcon_close(); + /* disconnect iotcon */ + iotcon_disconnect(); return 0; } diff --git a/test/iotcon-test-repr-server.c b/test/iotcon-test-repr-server.c index 42d3935..6482561 100644 --- a/test/iotcon-test-repr-server.c +++ b/test/iotcon-test-repr-server.c @@ -490,10 +490,10 @@ int main(int argc, char **argv) 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; } @@ -501,14 +501,14 @@ int main(int argc, char **argv) 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; } @@ -519,7 +519,7 @@ int main(int argc, char **argv) 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); @@ -529,7 +529,7 @@ int main(int argc, char **argv) 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"); @@ -537,7 +537,7 @@ int main(int argc, char **argv) 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; } @@ -549,7 +549,7 @@ int main(int argc, char **argv) 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); @@ -559,7 +559,7 @@ int main(int argc, char **argv) ERR("iotcon_resource_bind_child_resource() Fail"); iotcon_resource_destroy(light_handle); iotcon_resource_destroy(room_handle); - iotcon_close(); + iotcon_disconnect(); return -1; } @@ -569,8 +569,8 @@ int main(int argc, char **argv) iotcon_resource_destroy(light_handle); iotcon_resource_destroy(room_handle); - /* iotcon close */ - iotcon_close(); + /* disconnect iotcon */ + iotcon_disconnect(); return 0; } -- 2.7.4