Linux bluetooth development
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: Lukasz Rymanowski <lukasz.rymanowski@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] android/gatt: Remove reconnect feature
Date: Fri, 18 Apr 2014 15:16:43 +0200	[thread overview]
Message-ID: <1748862.qvstokQPbp@uw000953> (raw)
In-Reply-To: <1397679511-16947-1-git-send-email-lukasz.rymanowski@tieto.com>

Hi Łukasz,

On Wednesday 16 of April 2014 22:18:31 Lukasz Rymanowski wrote:
> This patch removes reconnect try when remote BLE device got
> disconnected.
> This is to avoid confusion of Android framework which now get ACL
> states changed event with state disconnected on Bluetooth HAL but no
> disconnected Event on GATT HAL.
> ---
>  android/gatt.c | 20 ++------------------
>  1 file changed, 2 insertions(+), 18 deletions(-)
> 
> diff --git a/android/gatt.c b/android/gatt.c
> index f52cb36..fa664cd 100644
> --- a/android/gatt.c
> +++ b/android/gatt.c
> @@ -864,25 +864,9 @@ static gboolean disconnected_cb(GIOChannel *io, GIOCondition cond,
>  
>  	sock = g_io_channel_unix_get_fd(io);
>  	len = sizeof(err);
> -	if (getsockopt(sock, SOL_SOCKET, SO_ERROR, &err, &len) < 0)
> -		goto done;
> -
> -	DBG("%s (%d)", strerror(err), err);
> -
> -	/* Keep scanning/re-connection active if disconnection reason
> -	 * is connection timeout, remote user terminated connection or local
> -	 * initiated disconnection.
> -	 */
> -	if (err == ETIMEDOUT || err == ECONNRESET || err == ECONNABORTED) {
> -		if (!queue_push_tail(conn_wait_queue, dev)) {
> -			error("gatt: Cannot push data");
> -		} else {
> -			bt_le_discovery_start(le_device_found_handler);
> -			return FALSE;
> -		}
> -	}
> +	if (!getsockopt(sock, SOL_SOCKET, SO_ERROR, &err, &len))
> +		DBG("%s (%d)", strerror(err), err);
>  
> -done:
>  	connection_cleanup(dev);
>  
>  	queue_foreach(dev->clients, client_disconnect_notify, dev);
> 

Applied, thanks.

-- 
Best regards, 
Szymon Janc

      reply	other threads:[~2014-04-18 13:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-16 20:18 [PATCH] android/gatt: Remove reconnect feature Lukasz Rymanowski
2014-04-18 13:16 ` Szymon Janc [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1748862.qvstokQPbp@uw000953 \
    --to=szymon.janc@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=lukasz.rymanowski@tieto.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox