linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
To: Mikel Astiz <mikel.astiz.oss@gmail.com>
Cc: linux-bluetooth@vger.kernel.org, Mikel Astiz <mikel.astiz@bmw-carit.de>
Subject: Re: [PATCH BlueZ v2 2/6] audio: Add multiple device search to manager
Date: Wed, 2 May 2012 15:25:30 -0300	[thread overview]
Message-ID: <20120502182529.GB4019@samus> (raw)
In-Reply-To: <1335776199-16704-3-git-send-email-mikel.astiz.oss@gmail.com>

Hi Mikel,

On 10:56 Mon 30 Apr, Mikel Astiz wrote:
> From: Mikel Astiz <mikel.astiz@bmw-carit.de>
> 
> This method is useful to search or than one device fulfulling certain

I guess you meant "for more than one".

Other than this nitpick the patch looks good.

> criteria.
> ---
>  audio/manager.c |   25 ++++++++++++++++++++++---
>  audio/manager.h |    6 ++++++
>  2 files changed, 28 insertions(+), 3 deletions(-)
> 
> diff --git a/audio/manager.c b/audio/manager.c
> index 20453e6..9c7d0d3 100644
> --- a/audio/manager.c
> +++ b/audio/manager.c
> @@ -1300,12 +1300,13 @@ void audio_manager_exit(void)
>  	btd_unregister_device_driver(&audio_driver);
>  }
>  
> -struct audio_device *manager_find_device(const char *path,
> +GSList *manager_find_devices(const char *path,
>  					const bdaddr_t *src,
>  					const bdaddr_t *dst,
>  					const char *interface,
>  					gboolean connected)
>  {
> +	GSList *result = NULL;
>  	GSList *l;
>  
>  	for (l = devices; l != NULL; l = l->next) {
> @@ -1343,10 +1344,28 @@ struct audio_device *manager_find_device(const char *path,
>  		if (connected && !audio_device_is_active(dev, interface))
>  			continue;
>  
> -		return dev;
> +		result = g_slist_append(result, dev);
>  	}
>  
> -	return NULL;
> +	return result;
> +}
> +
> +struct audio_device *manager_find_device(const char *path,
> +					const bdaddr_t *src,
> +					const bdaddr_t *dst,
> +					const char *interface,
> +					gboolean connected)
> +{
> +	struct audio_device *result;
> +	GSList *l;
> +
> +	l = manager_find_devices(path, src, dst, interface, connected);
> +	if (l == NULL)
> +		return NULL;
> +
> +	result = l->data;
> +	g_slist_free(l);
> +	return result;
>  }
>  
>  struct audio_device *manager_get_device(const bdaddr_t *src,
> diff --git a/audio/manager.h b/audio/manager.h
> index cfc646c..f1d3021 100644
> --- a/audio/manager.h
> +++ b/audio/manager.h
> @@ -46,6 +46,12 @@ struct audio_device *manager_find_device(const char *path,
>  					const char *interface,
>  					gboolean connected);
>  
> +GSList *manager_find_devices(const char *path,
> +					const bdaddr_t *src,
> +					const bdaddr_t *dst,
> +					const char *interface,
> +					gboolean connected);
> +
>  struct audio_device *manager_get_device(const bdaddr_t *src,
>  					const bdaddr_t *dst,
>  					gboolean create);
> -- 
> 1.7.7.6
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


Cheers,
-- 
Vinicius

  reply	other threads:[~2012-05-02 18:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-30  8:56 [PATCH BlueZ v2 0/6] Multiple Bluetooth SCO connections (userspace) Mikel Astiz
2012-04-30  8:56 ` [PATCH BlueZ v2 1/6] audio: Fix gateway state check Mikel Astiz
2012-04-30  8:56 ` [PATCH BlueZ v2 2/6] audio: Add multiple device search to manager Mikel Astiz
2012-05-02 18:25   ` Vinicius Costa Gomes [this message]
2012-04-30  8:56 ` [PATCH BlueZ v2 3/6] media: Support multiple transports per endpoint Mikel Astiz
2012-04-30  8:56 ` [PATCH BlueZ v2 4/6] media: Split media_endpoint_create Mikel Astiz
2012-05-02 12:21   ` Luiz Augusto von Dentz
2012-04-30  8:56 ` [PATCH BlueZ v2 5/6] media: Create multiple transports if needed Mikel Astiz
2012-04-30  8:56 ` [PATCH BlueZ v2 6/6] media: Enable parallel requests to endpoint Mikel Astiz

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=20120502182529.GB4019@samus \
    --to=vinicius.gomes@openbossa.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=mikel.astiz.oss@gmail.com \
    --cc=mikel.astiz@bmw-carit.de \
    /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;
as well as URLs for NNTP newsgroup(s).