RE: [RFC BlueZ 1/1] Add provision for terminating an ATT connection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Johan,

Do you have any comments on the below patch.


-----Original Message-----
From: Smriti GUPTA 
Sent: Monday, December 26, 2011 3:46 PM
To: linux-bluetooth@xxxxxxxxxxxxxxx
Cc: Naresh-kumar GUPTA; Smriti GUPTA
Subject: [RFC BlueZ 1/1] Add provision for terminating an ATT connection

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

Regards,
Smriti

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux