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,

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