Re: [PATCH v5] Fix disconnect devices after enabling offline mode

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

 



Hi Rafal,

On Wed, Jun 01, 2011, Rafal Michalski wrote:
> Previously paired and connected devices were disconnected automatically
> after turning bluetooth off directly via bluetooth UI. This patch makes
> that also other ways of turning bluetooth off (which should lead to
> disconnecting paired and connected devices), such as enabling offline
> mode (which turns bluetooth off as well), can be handled properly.
> ---
>  src/adapter.c |   40 ++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 40 insertions(+), 0 deletions(-)

Thanks. The patch has now been pushed upstream with one more minor
change:

> +	if (adapter->connections) {
> +		g_slist_foreach(adapter->connections,
> +				(GFunc) device_request_disconnect, NULL);
> +
> +		adapter->off_timer = g_timeout_add_seconds(OFF_TIMER,
> +					switch_off_timeout, adapter);
> +
> +		return 0;
> +	}
> +
>  	return adapter_ops->set_powered(adapter->dev_id, FALSE);
>  }

I switched this around to:

	if (adapter->connections == NULL)
		return adapter_ops->set_powered(adapter->dev_id, FALSE);
	...

It makes it bit more readable.

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