Use shared connection instead of private connection
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-gatt-client.c
index 07daf0b..b51dbc5 100644 (file)
@@ -190,7 +190,7 @@ BT_EXPORT_API int bluetooth_gatt_get_service_property(const char *service_handle
        BT_CHECK_PARAMETER(service, return);
        BT_CHECK_ENABLED(return);
 
-       g_conn = _bt_get_system_private_conn();
+       g_conn = _bt_get_system_common_conn();
        retv_if(g_conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        properties_proxy = g_dbus_proxy_new_sync(g_conn,
@@ -505,7 +505,7 @@ BT_EXPORT_API int bluetooth_gatt_discover_service_characteristics(
        BT_CHECK_PARAMETER(service_handle, return);
        BT_CHECK_ENABLED(return);
 
-       g_conn = _bt_get_system_private_conn();
+       g_conn = _bt_get_system_common_conn();
        retv_if(g_conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        properties_proxy = g_dbus_proxy_new_sync(g_conn,
@@ -629,7 +629,7 @@ BT_EXPORT_API int bluetooth_gatt_get_characteristics_property(
 
        BT_CHECK_ENABLED(return);
 
-       g_conn = _bt_get_system_private_conn();
+       g_conn = _bt_get_system_common_conn();
        retv_if(g_conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        properties_proxy = g_dbus_proxy_new_sync(g_conn,
@@ -794,7 +794,7 @@ BT_EXPORT_API int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
        BT_CHECK_PARAMETER(char_uuid, return);
        BT_CHECK_ENABLED(return);
 
-       g_conn = _bt_get_system_private_conn();
+       g_conn = _bt_get_system_common_conn();
        retv_if(g_conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        properties_proxy = g_dbus_proxy_new_sync(g_conn,
@@ -840,7 +840,7 @@ BT_EXPORT_API int bluetooth_gatt_get_char_descriptor_property(
 
        BT_CHECK_ENABLED(return);
 
-       g_conn = _bt_get_system_private_conn();
+       g_conn = _bt_get_system_common_conn();
        retv_if(g_conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        properties_proxy = g_dbus_proxy_new_sync(g_conn,
@@ -970,7 +970,7 @@ static void __bluetooth_internal_read_cb(GObject *source_object,
 
        BT_DBG("+");
 
-       system_gconn = _bt_get_system_private_conn();
+       system_gconn = _bt_get_system_common_conn();
        value = g_dbus_connection_call_finish(system_gconn, res, &error);
 
        user_info = _bt_get_user_data(BT_COMMON);
@@ -1031,7 +1031,7 @@ BT_EXPORT_API int bluetooth_gatt_read_characteristic_value(const char *chr,
        BT_CHECK_PARAMETER(chr, return);
        BT_CHECK_ENABLED(return);
 
-       conn = _bt_get_system_private_conn();
+       conn = _bt_get_system_common_conn();
        retv_if(conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        resp_data = g_malloc0(sizeof(bt_gatt_resp_data_t));
@@ -1068,7 +1068,7 @@ static void __bluetooth_internal_write_cb(GObject *source_object,
        int att_ecode = 0;
        bt_gatt_resp_data_t *resp_data = user_data;
 
-       system_gconn = _bt_get_system_private_conn();
+       system_gconn = _bt_get_system_common_conn();
        value = g_dbus_connection_call_finish(system_gconn, res, &error);
 
        user_info = _bt_get_user_data(BT_COMMON);
@@ -1121,7 +1121,7 @@ BT_EXPORT_API int bluetooth_gatt_set_characteristics_value(
        retv_if(length == 0, BLUETOOTH_ERROR_INVALID_PARAM);
        BT_CHECK_ENABLED(return);
 
-       conn = _bt_get_system_private_conn();
+       conn = _bt_get_system_common_conn();
        retv_if(conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        builder1 = g_variant_builder_new(G_VARIANT_TYPE("ay"));
@@ -1186,7 +1186,7 @@ BT_EXPORT_API int bluetooth_gatt_set_characteristics_value_by_type(
        retv_if(length == 0, BLUETOOTH_ERROR_INVALID_PARAM);
        BT_CHECK_ENABLED_INTERNAL(return);
 
-       conn = _bt_get_system_private_conn();
+       conn = _bt_get_system_common_conn();
        retv_if(conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        builder1 = g_variant_builder_new(G_VARIANT_TYPE("ay"));
@@ -1241,7 +1241,7 @@ BT_EXPORT_API int bluetooth_gatt_set_characteristics_value_request(
        retv_if(length == 0, BLUETOOTH_ERROR_INVALID_PARAM);
        BT_CHECK_ENABLED(return);
 
-       conn = _bt_get_system_private_conn();
+       conn = _bt_get_system_common_conn();
        retv_if(conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        builder1 = g_variant_builder_new(G_VARIANT_TYPE("ay"));
@@ -1300,7 +1300,7 @@ static int __bluetooth_gatt_descriptor_iter(const char *char_handle,
        const gchar *key;
        char_descriptor_type_t desc_type = TYPE_NONE;
 
-       g_conn = _bt_get_system_private_conn();
+       g_conn = _bt_get_system_common_conn();
        retv_if(g_conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        properties_proxy = g_dbus_proxy_new_sync(g_conn,
@@ -1466,7 +1466,7 @@ BT_EXPORT_API int bltooth_gatt_discover_characteristic_descriptor(
        BT_CHECK_PARAMETER(characteristic_handle, return);
        BT_CHECK_ENABLED(return);
 
-       g_conn = _bt_get_system_private_conn();
+       g_conn = _bt_get_system_common_conn();
        retv_if(g_conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        properties_proxy = g_dbus_proxy_new_sync(g_conn,
@@ -1507,7 +1507,7 @@ static void __bluetooth_internal_read_desc_cb(GObject *source_object,
 
        BT_DBG("+");
 
-       system_gconn = _bt_get_system_private_conn();
+       system_gconn = _bt_get_system_common_conn();
        value = g_dbus_connection_call_finish(system_gconn, res, &error);
 
        user_info = _bt_get_user_data(BT_COMMON);
@@ -1571,7 +1571,7 @@ BT_EXPORT_API int bluetooth_gatt_read_descriptor_value(const char *desc,
        BT_CHECK_PARAMETER(desc, return);
        BT_CHECK_ENABLED(return);
 
-       conn = _bt_get_system_private_conn();
+       conn = _bt_get_system_common_conn();
        retv_if(conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        resp_data = g_malloc0(sizeof(bt_gatt_resp_data_t));
@@ -1611,7 +1611,7 @@ static void __bluetooth_internal_write_desc_cb(GObject *source_object,
 
        BT_DBG("+");
 
-       system_gconn = _bt_get_system_private_conn();
+       system_gconn = _bt_get_system_common_conn();
        value = g_dbus_connection_call_finish(system_gconn, res, &error);
 
        user_info = _bt_get_user_data(BT_COMMON);
@@ -1665,7 +1665,7 @@ BT_EXPORT_API int bluetooth_gatt_write_descriptor_value(const char *desc,
        retv_if(length == 0, BLUETOOTH_ERROR_INVALID_PARAM);
        BT_CHECK_ENABLED(return);
 
-       conn = _bt_get_system_private_conn();
+       conn = _bt_get_system_common_conn();
        retv_if(conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        builder1 = g_variant_builder_new(G_VARIANT_TYPE("ay"));
@@ -1715,7 +1715,7 @@ BT_EXPORT_API int bluetooth_gatt_watch_characteristics(const char *char_handle,
 
        BT_INFO_C("### Enable CCCD : %s [%s]", char_handle + 15, svc_name);
 
-       conn = _bt_get_system_private_conn();
+       conn = _bt_get_system_common_conn();
        retv_if(conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        g_dbus_connection_call_sync(conn,
@@ -1765,7 +1765,7 @@ BT_EXPORT_API int bluetooth_gatt_unwatch_characteristics(const char *char_handle
 
        BT_INFO("Disable CCCD : %s", char_handle);
 
-       conn = _bt_get_system_private_conn();
+       conn = _bt_get_system_common_conn();
        retv_if(conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        g_dbus_connection_call_sync(conn,