return BLUETOOTH_ERROR_NONE;
}
+int _bt_disconnect_ext_profile(char *address, char *path)
+{
+ GDBusProxy *proxy;
+ char *object_path;
+
+ object_path = _bt_get_device_object_path(address);
+ if (object_path == NULL)
+ return BLUETOOTH_ERROR_INTERNAL;
+
+ proxy = __bt_gdbus_get_device_proxy(object_path);
+ g_free(object_path);
+ if (proxy == NULL) {
+ BT_ERR("Error while getting proxy");
+ return BLUETOOTH_ERROR_INTERNAL;
+ }
+
+ g_dbus_proxy_call(proxy, "DisconnectExtProfile",
+ g_variant_new("(o)", path),
+ G_DBUS_CALL_FLAGS_NONE,
+ DBUS_TIMEOUT, NULL, NULL, NULL);
+ BT_DBG("-");
+ return BLUETOOTH_ERROR_NONE;
+}
+
int _bt_get_adapter_path(GDBusConnection *conn, char *path)
{
GError *err = NULL;
close(conn_info->fd);
conn_info->disconnected = TRUE;
- _bt_disconnect_profile(conn_info->bt_addr, info->uuid,
- NULL, NULL);
-
+ _bt_disconnect_ext_profile(conn_info->bt_addr,
+ info->obj_path);
}
client = client->next;
conn_info->disconnected = TRUE;
BT_INFO("conn_info %s", conn_info->bt_addr);
- _bt_disconnect_profile(conn_info->bt_addr, info->uuid, NULL, NULL);
+ _bt_disconnect_ext_profile(conn_info->bt_addr, info->obj_path);
if (info->idle_id == 0)
info->idle_id = g_idle_add(__rfcomm_client_disconnect, info);
close(fd);
_bt_convert_addr_type_to_string(addr_str, addr->addr);
- _bt_disconnect_profile(addr_str, info->uuid, NULL, NULL);
+ _bt_disconnect_ext_profile(addr_str, info->path);
return -1;
}
_bt_convert_addr_type_to_string(addr,
conn_info->addr.addr);
- _bt_disconnect_profile(addr, info->uuid, NULL, NULL);
+ _bt_disconnect_ext_profile(addr, info->path);
}
server = server->next;
_bt_convert_addr_type_to_string(address, conn->addr.addr);
BT_DBG("Address %s", address);
- _bt_disconnect_profile(address, info->uuid, NULL, NULL);
+ _bt_disconnect_ext_profile(address, info->path);
if (info->disconnect_idle_id == 0)
info->disconnect_idle_id = g_idle_add(
gpointer func_data);
int _bt_disconnect_profile(char *address, char *uuid, void *cb,
gpointer func_data);
+int _bt_disconnect_ext_profile(char *address, char *path);
int _bt_cancel_discovers(char *address);
int _bt_discover_services(char *address, char *uuid, void *cb,