From c4a8ba6d82f1b5c7f14c2abc01242925c60b468d Mon Sep 17 00:00:00 2001 From: Smriti Gupta Date: Fri, 20 Jan 2012 17:24:26 +0530 Subject: [PATCH] core: Add provision for terminating an ATT connection In order to terminate any existing ATT connection from the client side existing function device_request_disconnect has been updated. --- src/device.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/device.c b/src/device.c index 93e454e8a..46f26d1da 100644 --- a/src/device.c +++ b/src/device.c @@ -790,6 +790,14 @@ void device_request_disconnect(struct btd_device *device, DBusMessage *msg) browse_request_cancel(device->browse); } + if (device->attrib) { + GIOChannel *io = g_attrib_get_channel(device->attrib); + if (io) { + g_io_channel_shutdown(io, FALSE, NULL); + g_io_channel_unref(io); + } + } + if (msg) device->disconnects = g_slist_append(device->disconnects, dbus_message_ref(msg)); -- 2.47.3