linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC BlueZ 0/1] Add provision for terminating an ATT connection
@ 2011-12-26 10:16 smriti
  2011-12-26 10:16 ` [RFC BlueZ 1/1] " smriti
  0 siblings, 1 reply; 5+ messages in thread
From: smriti @ 2011-12-26 10:16 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: naresh.gupta, smriti

The disconnect function was needed in order to terminate any existing
ATT connection from the client side. 

smriti (1):
  Add provision for terminating an ATT connection

 src/device.c |   14 ++++++++++++++
 src/device.h |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC BlueZ 1/1] Add provision for terminating an ATT connection
  2011-12-26 10:16 [RFC BlueZ 0/1] Add provision for terminating an ATT connection smriti
@ 2011-12-26 10:16 ` smriti
  2012-01-19  5:33   ` Smriti GUPTA
  0 siblings, 1 reply; 5+ messages in thread
From: smriti @ 2011-12-26 10:16 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: naresh.gupta, smriti

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [RFC BlueZ 1/1] Add provision for terminating an ATT connection
  2011-12-26 10:16 ` [RFC BlueZ 1/1] " smriti
@ 2012-01-19  5:33   ` Smriti GUPTA
  2012-01-19  7:57     ` Johan Hedberg
  0 siblings, 1 reply; 5+ messages in thread
From: Smriti GUPTA @ 2012-01-19  5:33 UTC (permalink / raw)
  To: johan.hedberg@gmail.com
  Cc: Naresh-kumar GUPTA, smritigupta2008@gmail.com,
	linux-bluetooth@vger.kernel.org

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@vger.kernel.org
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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RFC BlueZ 1/1] Add provision for terminating an ATT connection
  2012-01-19  5:33   ` Smriti GUPTA
@ 2012-01-19  7:57     ` Johan Hedberg
  2012-01-23  5:25       ` Smriti GUPTA
  0 siblings, 1 reply; 5+ messages in thread
From: Johan Hedberg @ 2012-01-19  7:57 UTC (permalink / raw)
  To: Smriti GUPTA
  Cc: Naresh-kumar GUPTA, smritigupta2008@gmail.com,
	linux-bluetooth@vger.kernel.org

Hi,

On Thu, Jan 19, 2012, Smriti GUPTA wrote:
> Do you have any comments on the below patch.

Sure,

> --- 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);

I don't think any separate function like this should be needed. Instead,
the existing device_request_disconnect() function should be extended
take care of bringing down any ATT connections.

Johan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [RFC BlueZ 1/1] Add provision for terminating an ATT connection
  2012-01-19  7:57     ` Johan Hedberg
@ 2012-01-23  5:25       ` Smriti GUPTA
  0 siblings, 0 replies; 5+ messages in thread
From: Smriti GUPTA @ 2012-01-23  5:25 UTC (permalink / raw)
  To: Johan Hedberg
  Cc: Naresh-kumar GUPTA, smritigupta2008@gmail.com,
	linux-bluetooth@vger.kernel.org

Hi Johan,

-----Original Message-----
From: Johan Hedberg [mailto:johan.hedberg@gmail.com] 
Sent: Thursday, January 19, 2012 1:27 PM
To: Smriti GUPTA
Cc: Naresh-kumar GUPTA; smritigupta2008@gmail.com; linux-bluetooth@vger.kernel.org
Subject: Re: [RFC BlueZ 1/1] Add provision for terminating an ATT connection

Hi,

On Thu, Jan 19, 2012, Smriti GUPTA wrote:
> Do you have any comments on the below patch.

Sure,

> --- 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);

I don't think any separate function like this should be needed. Instead,
the existing device_request_disconnect() function should be extended
take care of bringing down any ATT connections.
Thanks for your suggestions.
I have uploaded a new patch, please have a look.

Johan

Regards,
Smriti

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-01-23  5:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-26 10:16 [RFC BlueZ 0/1] Add provision for terminating an ATT connection smriti
2011-12-26 10:16 ` [RFC BlueZ 1/1] " smriti
2012-01-19  5:33   ` Smriti GUPTA
2012-01-19  7:57     ` Johan Hedberg
2012-01-23  5:25       ` Smriti GUPTA

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).