[Bluetooth][OTP-Client] Handle GATT operations for OTP
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / bt-service-network.c
index e175573..18875c7 100644 (file)
@@ -255,7 +255,7 @@ int _bt_network_activate(void)
        GDBusConnection *conn;
        GDBusProxy *server_proxy;
 
-       conn = _bt_get_system_gconn();
+       conn = _bt_gdbus_get_system_gconn();
        retv_if(conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        adapter_path = _bt_get_adapter_path();
@@ -281,11 +281,11 @@ int _bt_network_activate(void)
                if (err != NULL) {
                        g_dbus_error_strip_remote_error(err);
                        BT_ERR("Network server register Error: %s\n", err->message);
-                       if (g_strcmp0(err->message, "Already Exists") == 0) {
+                       if (g_strcmp0(err->message, "Already Exists") == 0)
                                ret = BLUETOOTH_ERROR_ALREADY_INITIALIZED;
-                       } else {
+                       else
                                ret = BLUETOOTH_ERROR_INTERNAL;
-                       }
+
                        g_error_free(err);
                }
        } else {
@@ -306,7 +306,7 @@ int _bt_network_deactivate(void)
        GDBusProxy *server_proxy;
        int ret = BLUETOOTH_ERROR_NONE;
 
-       conn = _bt_get_system_gconn();
+       conn = _bt_gdbus_get_system_gconn();
        retv_if(conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        adapter_path = _bt_get_adapter_path();
@@ -384,7 +384,7 @@ int _bt_network_connect(int request_id, int role,
        adapter_proxy = _bt_get_adapter_proxy();
        retv_if(adapter_proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
 
-       conn = _bt_get_system_gconn();
+       conn = _bt_gdbus_get_system_gconn();
        retv_if(conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        _bt_convert_addr_type_to_string(address, device_address->addr);
@@ -416,8 +416,6 @@ int _bt_network_connect(int request_id, int role,
        g_variant_unref(result);
        retv_if(profile_proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
        func_data = g_malloc0(sizeof(bt_function_data_t));
-       retv_if(func_data == NULL, BLUETOOTH_ERROR_MEMORY_ALLOCATION);
-
        func_data->address = g_strdup(address);
        func_data->req_id = request_id;
 
@@ -449,7 +447,7 @@ int _bt_network_disconnect(int request_id,
        adapter_proxy = _bt_get_adapter_proxy();
        retv_if(adapter_proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
 
-       conn = _bt_get_system_gconn();
+       conn = _bt_gdbus_get_system_gconn();
        retv_if(conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        _bt_convert_addr_type_to_string(address, device_address->addr);
@@ -481,8 +479,6 @@ int _bt_network_disconnect(int request_id,
        g_variant_unref(result);
        retv_if(profile_proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
        func_data = g_malloc0(sizeof(bt_function_data_t));
-       retv_if(func_data == NULL, BLUETOOTH_ERROR_MEMORY_ALLOCATION);
-
        func_data->address = g_strdup(address);
        func_data->req_id = request_id;
 
@@ -508,7 +504,7 @@ int _bt_network_server_disconnect(int request_id,
 
        BT_CHECK_PARAMETER(device_address, return);
 
-       conn = _bt_get_system_gconn();
+       conn = _bt_gdbus_get_system_gconn();
        retv_if(conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        adapter_path = _bt_get_adapter_path();