linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: smriti <smriti.gupta@stericsson.com>
To: <linux-bluetooth@vger.kernel.org>
Cc: <naresh.gupta@stericsson.com>, smriti <smriti.gupta@stericsson.com>
Subject: [RFC BlueZ 1/1] Add provision for terminating an ATT connection
Date: Mon, 26 Dec 2011 15:46:10 +0530	[thread overview]
Message-ID: <1324894570-15226-2-git-send-email-smriti.gupta@stericsson.com> (raw)
In-Reply-To: <1324894570-15226-1-git-send-email-smriti.gupta@stericsson.com>

This patch adds a function for disconnecting an ATT connection
from the client side.
---
 src/device.c |   14 ++++++++++++++
 src/device.h |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/device.c b/src/device.c
index e49e9bc..552df6e 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2880,3 +2880,17 @@ gboolean btd_device_remove_attio_callback(struct btd_device *device, guint id)
 
 	return TRUE;
 }
+
+void att_disconnect(struct btd_device *device)
+{
+	GIOChannel *io;
+
+	if (!device)
+		return;
+
+	io = g_attrib_get_channel(device->attrib);
+	if (io) {
+		g_io_channel_shutdown(io, FALSE, NULL);
+		g_io_channel_unref(io);
+	}
+}
diff --git a/src/device.h b/src/device.h
index 13005ae..bd14315 100644
--- a/src/device.h
+++ b/src/device.h
@@ -119,3 +119,4 @@ int device_block(DBusConnection *conn, struct btd_device *device,
 						gboolean update_only);
 int device_unblock(DBusConnection *conn, struct btd_device *device,
 					gboolean silent, gboolean update_only);
+void att_disconnect(struct btd_device *device);
\ No newline at end of file
-- 
1.7.0.4


  reply	other threads:[~2011-12-26 10:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-26 10:16 [RFC BlueZ 0/1] Add provision for terminating an ATT connection smriti
2011-12-26 10:16 ` smriti [this message]
2012-01-19  5:33   ` [RFC BlueZ 1/1] " Smriti GUPTA
2012-01-19  7:57     ` Johan Hedberg
2012-01-23  5:25       ` Smriti GUPTA

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1324894570-15226-2-git-send-email-smriti.gupta@stericsson.com \
    --to=smriti.gupta@stericsson.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=naresh.gupta@stericsson.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).