Linux bluetooth development
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: Jakub Tyszkowski <jakub.tyszkowski@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] android/gatt: Fix adding duplicate connection for server apps
Date: Fri, 03 Oct 2014 12:49:54 +0200	[thread overview]
Message-ID: <2614039.CqHTy7gBEc@uw000953> (raw)
In-Reply-To: <1412332929-14595-1-git-send-email-jakub.tyszkowski@tieto.com>

Hi Jakub,

On Friday 03 of October 2014 12:42:09 Jakub Tyszkowski wrote:
> This replaces the usage of unsafe function for adding app connections
> with the one that is almost the same but first it checks if no
> duplicate entry is added to the list.
> 
> This fixes connection callback being sent twice for server app when it
> initiates the connection, and removes duplicated code.
> ---
>  android/gatt.c | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/android/gatt.c b/android/gatt.c
> index b4a2554..dbe067f 100644
> --- a/android/gatt.c
> +++ b/android/gatt.c
> @@ -6193,17 +6193,6 @@ done:
>  									NULL);
>  }
>  
> -static void create_listen_connections(void *data, void *user_data)
> -{
> -	struct gatt_device *dev = user_data;
> -	int32_t id = PTR_TO_INT(data);
> -	struct gatt_app *app;
> -
> -	app = find_app_by_id(id);
> -	if (app)
> -		create_connection(dev, app);
> -}
> -
>  static void connect_confirm(GIOChannel *io, void *user_data)
>  {
>  	struct gatt_device *dev;
> @@ -6252,7 +6241,7 @@ static void connect_confirm(GIOChannel *io, void *user_data)
>  		goto drop;
>  	}
>  
> -	queue_foreach(listen_apps, create_listen_connections, dev);
> +	queue_foreach(listen_apps, create_app_connection, dev);
>  	device_set_state(dev, DEVICE_CONNECT_READY);
>  
>  	return;
> 

Applied, thanks.

-- 
Best regards, 
Szymon Janc

      reply	other threads:[~2014-10-03 10:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-03 10:42 [PATCH] android/gatt: Fix adding duplicate connection for server apps Jakub Tyszkowski
2014-10-03 10:49 ` 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=2614039.CqHTy7gBEc@uw000953 \
    --to=szymon.janc@tieto.com \
    --cc=jakub.tyszkowski@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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