Ignore vconfkey value change for AVC mode on
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-device.c
index 8bb283d..8b80037 100644 (file)
 #include "bt-dpm.h"
 #endif
 
+BT_EXPORT_API int bluetooth_disconnect_device(const bluetooth_device_address_t *remote_address)
+{
+       int result;
+
+       BT_CHECK_PARAMETER(remote_address, return);
+       BT_CHECK_ENABLED(return);
+
+       BT_INIT_PARAMS();
+       BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       g_array_append_vals(in_param1, remote_address, sizeof(bluetooth_device_address_t));
+
+       result = _bt_send_request(BT_BLUEZ_SERVICE, BT_DISCONNECT_DEVICE,
+               in_param1, in_param2, in_param3, in_param4, &out_param);
+
+       BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       return result;
+}
+
 BT_EXPORT_API int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
 {
        int result;
@@ -344,7 +364,12 @@ BT_EXPORT_API int bluetooth_is_device_connected(const bluetooth_device_address_t
        return result;
 }
 
+#ifdef TIZEN_GATT_CLIENT
+BT_EXPORT_API int bluetooth_connect_le(const bluetooth_device_address_t *device_address,
+                                       gboolean auto_connect, int client_id)
+#else
 BT_EXPORT_API int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect)
+#endif
 {
        int result;
        bt_user_info_t *user_info;
@@ -364,6 +389,10 @@ BT_EXPORT_API int bluetooth_connect_le(const bluetooth_device_address_t *device_
        g_array_append_vals(in_param1, device_address, sizeof(bluetooth_device_address_t));
        g_array_append_vals(in_param2, &auto_connect, sizeof(gboolean));
 
+#ifdef TIZEN_GATT_CLIENT
+       g_array_append_vals(in_param3, &client_id, sizeof(int));
+#endif
+
        user_info = _bt_get_user_data(BT_COMMON);
        retv_if(user_info == NULL, BLUETOOTH_ERROR_INTERNAL);
 
@@ -377,7 +406,12 @@ BT_EXPORT_API int bluetooth_connect_le(const bluetooth_device_address_t *device_
        return result;
 }
 
+#ifdef TIZEN_GATT_CLIENT
+BT_EXPORT_API int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address,
+               int client_id)
+#else
 BT_EXPORT_API int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address)
+#endif
 {
        int result;
        bt_user_info_t *user_info;
@@ -386,7 +420,7 @@ BT_EXPORT_API int bluetooth_disconnect_le(const bluetooth_device_address_t *devi
        BT_CHECK_ENABLED_ANY(return);
 
        if (_bt_check_privilege(BT_CHECK_PRIVILEGE, BT_DISCONNECT_LE)
-            == BLUETOOTH_ERROR_PERMISSION_DEINED) {
+                       == BLUETOOTH_ERROR_PERMISSION_DEINED) {
                BT_ERR("Don't have a privilege to use this API");
                return BLUETOOTH_ERROR_PERMISSION_DEINED;
        }
@@ -395,6 +429,10 @@ BT_EXPORT_API int bluetooth_disconnect_le(const bluetooth_device_address_t *devi
        BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
 
        g_array_append_vals(in_param1, device_address, sizeof(bluetooth_device_address_t));
+#ifdef TIZEN_GATT_CLIENT
+       BT_DBG("Send GATT disconnect using Client Interface [%d]", client_id);
+       g_array_append_vals(in_param2, &client_id, sizeof(int));
+#endif
        user_info = _bt_get_user_data(BT_COMMON);
        retv_if(user_info == NULL, BLUETOOTH_ERROR_INTERNAL);
 
@@ -739,62 +777,6 @@ BT_EXPORT_API int bluetooth_get_profile_trusted(
        return result;
 }
 
-BT_EXPORT_API int bluetooth_set_profile_restricted(
-               const bluetooth_device_address_t *device_address,
-               int profile, int restricted)
-{
-       int result;
-
-       BT_CHECK_PARAMETER(device_address, return);
-       BT_CHECK_ENABLED(return);
-
-       BT_INIT_PARAMS();
-       BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
-
-       g_array_append_vals(in_param1, device_address, sizeof(bluetooth_device_address_t));
-       g_array_append_vals(in_param2, &profile, sizeof(int));
-       g_array_append_vals(in_param3, &restricted, sizeof(int));
-
-       result = _bt_send_request(BT_BLUEZ_SERVICE, BT_SET_PROFILE_RESTRICTED,
-                       in_param1, in_param2, in_param3, in_param4, &out_param);
-
-       if (result == BLUETOOTH_ERROR_NONE)
-               BT_DBG("SUCCESSFUL");
-
-       BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
-
-       return result;
-}
-
-BT_EXPORT_API int bluetooth_get_profile_restricted(
-               const bluetooth_device_address_t *device_address,
-               int profile, int *restricted)
-{
-       int result;
-       int restrict_profile = 0;
-       BT_CHECK_PARAMETER(device_address, return);
-       BT_CHECK_ENABLED(return);
-
-       BT_INIT_PARAMS();
-       BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
-
-       g_array_append_vals(in_param1, device_address, sizeof(bluetooth_device_address_t));
-       g_array_append_vals(in_param2, &profile, sizeof(int));
-
-       result = _bt_send_request(BT_BLUEZ_SERVICE, BT_GET_PROFILE_RESTRICTED,
-                       in_param1, in_param2, in_param3, in_param4, &out_param);
-
-       if (result == BLUETOOTH_ERROR_NONE) {
-               restrict_profile = g_array_index(out_param, guint, 0);
-               BT_DBG("SUCCESSFUL");
-       }
-       BT_DBG("Restricted %d", restrict_profile);
-       *restricted = restrict_profile;
-       BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
-
-       return result;
-}
-
 BT_EXPORT_API int bluetooth_passkey_reply(char *passkey, gboolean reply)
 {
        int result;