Hi Johan, -----Original Message----- From: Johan Hedberg [mailto:johan.hedberg@xxxxxxxxx] Sent: Thursday, January 19, 2012 1:27 PM To: Smriti GUPTA Cc: Naresh-kumar GUPTA; smritigupta2008@xxxxxxxxx; linux-bluetooth@xxxxxxxxxxxxxxx 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 -- 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